Search Linux Wireless

Re: [PATCH] libertas: add NULL check on return value of get_zeroed_page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 23, 2009 at 10:22:22PM +0530, Kiran Divekar wrote:
> From fb132b536facfbdc47a24afe538c50662d16b3ad Mon Sep 17 00:00:00 2001
> From: Kiran Divekar <kirandivekar@xxxxxxxxx>
> Date: Sun, 23 Aug 2009 22:05:21 +0530
> Subject: [PATCH] add NULL check on return value of get_zeroed_page
> 
> Most of the places in debugfs.c are missing a NULL check on the return value of
> get_zeroed_page API call. Added required NULL check at appropriate places.
> 
> Signed-off-by: Kiran Divekar <kirandivekar@xxxxxxxxx>

#1 -- Don't post the output of git format-patch directly like this.  Use git
	send-email instead.

> ---
>  drivers/net/wireless/libertas/debugfs.c |   28 ++++++++++++++++++++++++++++
>  1 files changed, 28 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/debugfs.c
> b/drivers/net/wireless/libertas/debugfs.c
> index 811ffc3..893a55c 100644
> --- a/drivers/net/wireless/libertas/debugfs.c
> +++ b/drivers/net/wireless/libertas/debugfs.c
> @@ -45,6 +45,8 @@ static ssize_t lbs_dev_info(struct file *file, char
> __user *userbuf,
>         unsigned long addr = get_zeroed_page(GFP_KERNEL);
>         char *buf = (char *)addr;
>         ssize_t res;
> +       if (!buf)
> +               return -ENOMEM;
> 
>         pos += snprintf(buf+pos, len-pos, "state = %s\n",
>                                 szStates[priv->connect_status]);

#2 -- Don't use an MUA that alters whitespace in the message.

Feel free to repost...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@xxxxxxxxxxxxx			might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux