Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e958051 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman
Browse files

usbip: vhci_hcd: fix return value check in add_platform_device()



In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d35cbed6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1211,8 +1211,8 @@ static int add_platform_device(int id)
		dev_nr = id;

	pdev = platform_device_register_simple(driver_name, dev_nr, NULL, 0);
	if (pdev == NULL)
		return -ENODEV;
	if (IS_ERR(pdev))
		return PTR_ERR(pdev);

	*(vhci_pdevs + id) = pdev;
	return 0;