mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d42ab0838d
commit
360e27a91d
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user