Re: [PATCH] Staging: gdm724x: gdm_usb: added error checking in do_tx()

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

 



On Wed, Sep 17, 2014 at 10:47:25PM +0200, Abel Moyo wrote:
> Added error checking for alloc_tx_struct in do_tx()
> 
> Signed-off-by: Abel Moyo <abelmoyo.ab@xxxxxxxxx>
> ---
>  drivers/staging/gdm724x/gdm_usb.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c
> index 483185b..0c20554 100644
> --- a/drivers/staging/gdm724x/gdm_usb.c
> +++ b/drivers/staging/gdm724x/gdm_usb.c
> @@ -682,6 +682,10 @@ static void do_tx(struct work_struct *work)
>  		}
>  
>  		t = alloc_tx_struct(TX_BUF_SIZE);
> +		if (t == NULL) {
> +			pr_err("alloc_tx_struct - out of memory");
> +			return;

There is a missing spin_unlock.

Don't print an error message.  There is already a much more useful error
message at the lower levels.  This one is just a waste of RAM.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux