]> git.baikalelectronics.ru Git - kernel.git/commit
staging: dgap: fix returned errno code in dgap_parsefile()
authorJavier Martinez Canillas <javier@osg.samsung.com>
Tue, 22 Sep 2015 00:39:36 +0000 (02:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:16:29 +0000 (04:16 +0200)
commit27946c7461b3b847fd8a75bd8bc9901ba0108da6
tree2bf0e324750d7e6f91d7861a17a81c4dc15c6291
parentfe8937664faeb04a475b4eb37ed1b6ceaa37cc9f
staging: dgap: fix returned errno code in dgap_parsefile()

The driver is using -1 instead of the -ENOMEM defined macro to specify
that a buffer allocation failed. Since the error number is propagated,
the caller will get a -EPERM which is the wrong error condition.

Also, the smatch tool complains with the following warning:

dgap_parsefile() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c