From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [patch] fb: handle allocation failure in alloc_apertures()
Date: Thu, 15 Jul 2010 18:32:26 +0000 [thread overview]
Message-ID: <20100715183226.GA2740@joi.lan> (raw)
In-Reply-To: <20100715083453.GA17585@bicker>
On Thu, Jul 15, 2010 at 10:39:47AM +0200, Dan Carpenter wrote:
> If the kzalloc() fails we should return NULL. All the places that call
> alloc_apertures() check for this already.
Thanks for fixing this. I added this function, so FWIW:
Acked-by: Marcin Slusarz <marcin.slusarz@gmail.com>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 8e5a9df..e7445df 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -873,6 +873,8 @@ struct fb_info {
> static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
> struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
> + max_num * sizeof(struct aperture), GFP_KERNEL);
> + if (!a)
> + return NULL;
> a->count = max_num;
> return a;
> }
>
prev parent reply other threads:[~2010-07-15 18:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-15 8:39 [patch] fb: handle allocation failure in alloc_apertures() Dan Carpenter
2010-07-15 14:35 ` James Simmons
2010-07-15 18:32 ` Marcin Slusarz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100715183226.GA2740@joi.lan \
--to=marcin.slusarz@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).