lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1357991692-13453-1-git-send-email-tobetter@gmail.com>
Date:	Sat, 12 Jan 2013 20:54:33 +0900
From:	Dongjin Kim <tobetter@...il.com>
To:	unlisted-recipients:; (no To-header on input)
Cc:	Dongjin Kim <tobetter@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] USB: misc: fixup smatch WARNING

This patch fixes the warning,

6a099c63650e50ebf7d1259b859a3d230aec4207 [4/10] USB: misc: Add USB3503 High-Speed Hub Controller

drivers/usb/misc/usb3503.c:238 usb3503_probe() error: we previously assumed 'pdata' could be null (see line 196)

Signed-off-by: Dongjin Kim <tobetter@...il.com>
---
 drivers/usb/misc/usb3503.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index 796d58c..7bc2812 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -182,12 +182,12 @@ int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
 {
 	struct usb3503_platform_data *pdata = i2c->dev.platform_data;
 	struct usb3503 *hub;
-	int err;
+	int err = -ENOMEM;
 
 	hub = kzalloc(sizeof(struct usb3503), GFP_KERNEL);
 	if (!hub) {
 		dev_err(&i2c->dev, "private data alloc fail\n");
-		return -ENOMEM;
+		return err;
 	}
 
 	i2c_set_clientdata(i2c, hub);
@@ -195,6 +195,7 @@ int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
 
 	if (!pdata) {
 		dev_dbg(&i2c->dev, "missing platform data\n");
+		goto err_out;
 	} else {
 		hub->gpio_intn		= pdata->gpio_intn;
 		hub->gpio_connect	= pdata->gpio_connect;
@@ -209,7 +210,7 @@ int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
 			dev_err(&i2c->dev,
 					"unable to request GPIO %d as connect pin (%d)\n",
 					hub->gpio_intn, err);
-			goto err_gpio_intn;
+			goto err_out;
 		}
 	}
 
@@ -248,7 +249,7 @@ err_gpio_reset:
 err_gpio_connect:
 	if (gpio_is_valid(hub->gpio_intn))
 		gpio_free(hub->gpio_intn);
-err_gpio_intn:
+err_out:
 	kfree(hub);
 
 	return err;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists