Re: [PATCH] firmware: Google VPD: Fix memory allocation error handling

2017-05-06 Thread Dan Carpenter
On Fri, May 05, 2017 at 12:56:47PM -0700, Greg KH wrote: > On Fri, May 05, 2017 at 09:08:44PM +0200, Christophe JAILLET wrote: > > 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 > >-

Re: [PATCH] firmware: Google VPD: Fix memory allocation error handling

2017-05-05 Thread Christophe JAILLET
Le 05/05/2017 à 21:56, Greg KH a écrit : On Fri, May 05, 2017 at 09:08:44PM +0200, Christophe JAILLET wrote: 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'

Re: [PATCH] firmware: Google VPD: Fix memory allocation error handling

2017-05-05 Thread Greg KH
On Fri, May 05, 2017 at 09:08:44PM +0200, Christophe JAILLET wrote: > 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 Then

[PATCH] firmware: Google VPD: Fix memory allocation error handling

2017-05-05 Thread Christophe JAILLET
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 handlin