]> git.baikalelectronics.ru Git - kernel.git/commit
gnss: fix potential error pointer dereference
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 16 Jul 2018 10:42:03 +0000 (12:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2018 10:48:07 +0000 (12:48 +0200)
commit0ab98e0202c237134a48414f6ce48bb9ebf2e429
tree98e3a413a9db294b3532ddcb5e59ce71afafac4e
parent035a2456a2d2b945c106101e5eb7c1c611bb538c
gnss: fix potential error pointer dereference

The gnss_allocate_device() function returns a mix of NULL and error
pointers on error.  It should only return one or the other.  Since the
callers both check for NULL, I've modified it to return NULL on error.

Fixes: db4c64828870 ("gnss: add GNSS receiver subsystem")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gnss/core.c