Re: [patch] USB: ene_ub6250: fix memory leak in ene_load_bincode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, you are right, thanks. :)

Thanks,
--huajun

2011/3/10 Dan Carpenter <error27@xxxxxxxxx>:
> "buf" gets allocated twice in a row.  It's the second allocation which
> is correct.  The first one should be removed.
>
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
>
> diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c
> index 058c5d5..08e0374 100644
> --- a/drivers/usb/storage/ene_ub6250.c
> +++ b/drivers/usb/storage/ene_ub6250.c
> @@ -491,10 +491,6 @@ static int ene_load_bincode(struct us_data *us, unsigned char flag)
>        if (info->BIN_FLAG == flag)
>                return USB_STOR_TRANSPORT_GOOD;
>
> -       buf = kmalloc(ENE_BIN_CODE_LEN, GFP_KERNEL);
> -       if (buf == NULL)
> -               return USB_STOR_TRANSPORT_ERROR;
> -
>        switch (flag) {
>        /* For SD */
>        case SD_INIT1_PATTERN:
>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux