[PATCH] usbip: fix odd_ptr_err.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PTR_ERR should access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

CC: Nobuo Iwata <nobuo.iwata@xxxxxxxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Signed-off-by: Julia Lawall <julia.lawall@xxxxxxx>
---

I haven't checked the complete context, but the code looks suspicious.

 usbip_ux.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/usbip/usbip_ux.c
+++ b/drivers/usb/usbip/usbip_ux.c
@@ -571,7 +571,7 @@ static int __init usbip_ux_init(void)
 	usbip_ux_dev = device_create(usbip_ux_class, NULL, usbip_ux_devno, NULL, USBIP_UX_DEV_NAME);
 	if (IS_ERR(usbip_ux_dev)) {
 		pr_err("Fail to create sysfs entry for %s\n", USBIP_UX_DEV_NAME);
-		ret = PTR_ERR(usbip_ux_class);
+		ret = PTR_ERR(usbip_ux_dev);
 		goto err_cdev_del;
 	}
 	return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux