diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2017-05-05 21:08:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-18 17:01:46 +0200 |
commit | 9434cec130a941e8a0698d598dfa5499dbdeb949 (patch) | |
tree | 144ae9078e32df6662652778621ae439c3677ad0 /drivers/fpga/fpga-region.c | |
parent | b299cde245b0b76c977f4291162cf668e087b408 (diff) |
firmware: Google VPD: Fix memory allocation error handling
This patch fixes several issues:
- if the 1st 'kzalloc' fails, we dereference a NULL pointer
- if the 2nd 'kzalloc' fails, there is a memory leak
- if 'sysfs_create_bin_file' fails there is also a memory leak
Fix it by adding a test after the first memory allocation and some error
handling paths to correctly free memory if needed.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga/fpga-region.c')
0 files changed, 0 insertions, 0 deletions