mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
staging: gasket: Remove stale pointers on error allocating attr array
If gasket_sysfs_create_mapping() hits errors allocating the attribute array, remove stale pointers to device info from the mapping object. Signed-off-by: Zhongze Hu <frankhu@chromium.org> Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cf2865a0c7
commit
03c25b3ad0
1 changed files with 2 additions and 0 deletions
|
|
@ -225,6 +225,8 @@ int gasket_sysfs_create_mapping(
|
|||
mapping->attribute_count = 0;
|
||||
if (!mapping->attributes) {
|
||||
gasket_nodev_error("Unable to allocate sysfs attribute array.");
|
||||
mapping->device = NULL;
|
||||
mapping->gasket_dev = NULL;
|
||||
mutex_unlock(&mapping->mutex);
|
||||
mutex_unlock(&function_mutex);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue