OSDN Git Service

staging: gasket: sysfs: fix potential null dereference
authorIvan Bornyakov <brnkv.i1@gmail.com>
Wed, 1 Aug 2018 18:37:44 +0000 (21:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Aug 2018 06:14:35 +0000 (08:14 +0200)
commit548b9f03f007ae654055644cff844b2b4fd2b5d2
tree01368256155b1b6c99379baf594538bad3b9b311
parentc0f460ffeb9545267c981895814af157e5dfc554
staging: gasket: sysfs: fix potential null dereference

Add handling of possible allocation failure.

Reported by smatch:

  drivers/staging/gasket/gasket_sysfs.c:105 put_mapping() error: potential null dereference 'files_to_remove'. (kcalloc returns null)

Signed-off-by: Ivan Bornyakov <brnkv.i1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gasket/gasket_sysfs.c