Message ID | 1353477576-26451-1-git-send-email-sachin.kamat@linaro.org |
---|---|
State | Not Applicable |
Headers | show |
On Wed, Nov 21, 2012 at 11:29:36AM +0530, Sachin Kamat wrote: > kfree on a null pointer is a no-op. > kdelete() used to accept NULL pointers but now it will oops. No one ever passes a NULL pointer, so it doesn't cause a problem. But if you noticed that, please put it into the changelog so we don't freak out. regards, dan carpenter
On 21 November 2012 14:47, Dan Carpenter <dan.carpenter@oracle.com> wrote: > On Wed, Nov 21, 2012 at 11:29:36AM +0530, Sachin Kamat wrote: >> kfree on a null pointer is a no-op. >> > > kdelete() used to accept NULL pointers but now it will oops. You are right. We can either leave it the way it was (i.e. drop this patch) or I remove the NULL assignment and re-send? No one > ever passes a NULL pointer, so it doesn't cause a problem. But if > you noticed that, please put it into the changelog so we don't freak > out. > > regards, > dan carpenter >
On Wed, Nov 21, 2012 at 08:38:29PM +0530, Sachin Kamat wrote: > On 21 November 2012 14:47, Dan Carpenter <dan.carpenter@oracle.com> wrote: > > On Wed, Nov 21, 2012 at 11:29:36AM +0530, Sachin Kamat wrote: > >> kfree on a null pointer is a no-op. > >> > > > > kdelete() used to accept NULL pointers but now it will oops. > > You are right. We can either leave it the way it was (i.e. drop this > patch) or I remove the NULL assignment > and re-send? Look at the code and determine what needs to be done. thanks, greg k-h
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index c302769..ea5accd 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -535,10 +535,8 @@ static int gdm_wimax_close(struct net_device *dev) static void kdelete(void **buf) { - if (buf && *buf) { - kfree(*buf); - *buf = NULL; - } + kfree(*buf); + *buf = NULL; } static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src)
kfree on a null pointer is a no-op. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> --- drivers/staging/gdm72xx/gdm_wimax.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)