lkml.org 
[lkml]   [2015]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] staging: wilc1000: fix freeing of ERR_PTR
    Date
    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>
    ---
    drivers/staging/wilc1000/linux_wlan.c | 6 ++----
    1 file changed, 2 insertions(+), 4 deletions(-)

    diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
    index c90c459..020ed03 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) {

    --
    1.9.1


    \
     
     \ /
      Last update: 2015-09-04 12:21    [W:2.320 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site