Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: typec: thunderbolt: Remove IS_ERR check for plug

Fixes these Smatch static checker warnings:
drivers/usb/typec/altmodes/thunderbolt.c:354 tbt_ready() warn: 'plug' is not an error pointer

Fixes: 100e25738659 ("usb: typec: Add driver for Thunderbolt 3 Alternate Mode")
Signed-off-by: Benson Leung <bleung@chromium.org>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/Z5PstnlA52Z1F2SU@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Benson Leung and committed by
Greg Kroah-Hartman
9682c35f b51c1e8d

+2 -2
+2 -2
drivers/usb/typec/altmodes/thunderbolt.c
··· 351 351 */ 352 352 for (int i = 0; i < TYPEC_PLUG_SOP_PP + 1; i++) { 353 353 plug = typec_altmode_get_plug(tbt->alt, i); 354 - if (IS_ERR(plug)) 354 + if (!plug) 355 355 continue; 356 356 357 - if (!plug || plug->svid != USB_TYPEC_TBT_SID) 357 + if (plug->svid != USB_TYPEC_TBT_SID) 358 358 break; 359 359 360 360 plug->desc = "Thunderbolt3";