diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-09-04 15:34:15 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-12 18:24:43 -0700 |
commit | 360e27a91dd25fb7cf3b2befa1e1a7b4f27828d2 (patch) | |
tree | dc6cbc8e2692a42d44c843a7105975a2dc32b0b0 /drivers | |
parent | d42ab0838d040bb57b2368125aeb49a8bf1d2383 (diff) | |
download | linux-360e27a91dd25fb7cf3b2befa1e1a7b4f27828d2.tar.bz2 |
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.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/wilc1000/linux_wlan.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index c90c45907422..020ed038130f 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -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) { |