staging: dgap: fix possible NULL dereference
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Thu, 10 Sep 2015 11:54:58 +0000 (17:24 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:57 +0000 (18:24 -0700)
commit39be6b8b0cc84b33cd17bc570e80a25126f87c9c
tree7fa6601f9667a769d81c26592cd0b360d97f2ff6
parent60aff4ffba3336cd97789b60f086d47b1932147b
staging: dgap: fix possible NULL dereference

The return pointer from dgap_getword() is used in strcmp() where it is
dereferenced. But dgap_getword() can return NULL.
Lets put a check there and return 0 as error.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c