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

Commit a479c1ba authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

usb: android: Fix bug in ECM bind



The gether_setup_name() function returns the error as pointer. The
current code is checking the return value against NULL and failing
ECM bind for the success case. Use IS_ERR() to check the return
value.

Change-Id: I32d546a92fd91a6c63ea73df33ae0ee5ef702243
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent e3771b62
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2208,7 +2208,7 @@ static int ecm_function_bind_config(struct android_usb_function *f,
		ecm->ethaddr[3], ecm->ethaddr[4], ecm->ethaddr[5]);

	dev = gether_setup_name(c->cdev->gadget, ecm->ethaddr, "ecm");
	if (dev) {
	if (IS_ERR(dev)) {
		ret = PTR_ERR(dev);
		pr_err("%s: gether_setup failed\n", __func__);
		return ret;