OSDN Git Service

staging: lustre: lustre: mdc: lproc_mdc.c: Fix for potential NULL pointer dereference
authorKumar Amit Mehta <gmate.amit@gmail.com>
Mon, 26 Jan 2015 15:44:53 +0000 (16:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jan 2015 18:52:05 +0000 (10:52 -0800)
commitc1f79c74e222000386f3950ed98d150e6009648b
tree41c1541c9777e5363f909a570e3c68c0a8250230
parent1e3e981ad576eeb47ca1ca1743ff3b3d39e576a4
staging: lustre: lustre: mdc: lproc_mdc.c: Fix for potential NULL pointer dereference

In mdc_kuc_write(), OBD_ALLOC(lh, len) may leave 'lh' to NULL as kmalloc
may fail to allocate memory. This fix adds a check to avoid, dereferencing
a NULL pointer.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/mdc/lproc_mdc.c