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

Dan Carpenter dan.carpenter at oracle.com
Mon Sep 2 00:14:38 UTC 2013


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.

regards,
dan carpenter


More information about the devel mailing list