Re: [PATCH 06/12] staging: dgnc: removes kzalloc error statements

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

 



On Sun, Sep 1, 2013 at 8:14 PM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> The point I was trying to make earlier was that I don't like knee jerk
> error messages.  Some people put an error message after every line
> without thinking about it.  It's a very common source of bugs is to
> have a NULL dereference like:
>
>         if (!dev) {
>                 pr_err("no device %s", dev->name);
>                 return -EINVAL;
>         }
>
> It's a pet peeve of mine.  It should just be:
>
>         if (!dev)
>                 return -EINVAL;
>
>
> But in the future I will be more careful in how I say it.  Sorry again.

Its okay, its my fault. I had a feeling that I was doing it wrong, but
did it anyway. >_<

I'll keep the return values but remove the error messages.

Your emails and feedback have been clear and helpful thus far,
so thank you.
_______________________________________________
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