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)
commite98631d83c84adfee9d33f04808a6e0eb2fa0345
tree2bf0e324750d7e6f91d7861a17a81c4dc15c6291
parent3f937918b73b2a56ef238a2dcc0bbd97d48490b9
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