Skip to contentSkip to conversation

staging: wilc1000: fix freeing of ERR_PTR

PATCH New Sudip Mukherjee 1 participant 1 message Sep 4, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wilc1000: fix freeing of ERR_PTR

If memdup_user() fails then it will return the error code in ERR_PTR. We were checking it with IS_ERR but then again trying to free it on the error path.

---
 drivers/staging/wilc1000/linux_wlan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +2 -4
index c90c459..020ed03 100644
@@ -2116,10 +2116,8 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
 		if (size && wrq->u.data.pointer) {
 
 			buff = memdup_user(wrq->u.data.pointer, wrq->u.data.length);
-			if (IS_ERR(buff)) {
-				s32Error = PTR_ERR(buff);
-				goto done;
-			}
+			if (IS_ERR(buff))
+				return PTR_ERR(buff);
 
 			if (strncasecmp(buff, "RSSI", length) == 0) {
 
Signature · 1 line
1.9.1