From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Joe Perches <joe@perches.com>
Cc: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Jingoo Han <jg1.han@samsung.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] video: fbdev: skeletonfb.c: Adding code to managing allocation error
Date: Sat, 21 Jun 2014 20:48:37 +0000 [thread overview]
Message-ID: <CAMuHMdVJ=sA7ixyA+4BSffD1fzWOMwGivEQGZ+UN437VTw_xpw@mail.gmail.com> (raw)
In-Reply-To: <1403359116.4076.44.camel@joe-AO725>
On Sat, Jun 21, 2014 at 3:58 PM, Joe Perches <joe@perches.com> wrote:
> (Adding Geert, who probably wrote most of this
> and likely might have forgotten all of it)
>
> On Sat, 2014-06-21 at 15:17 +0200, Rickard Strandqvist wrote:
>> Adding missing code for managing a memory allocation error that may occur.
>>
>> This was partly found using a static code analysis program called cppcheck.
>
> skeletonfb.c is not meant to be compiled.
> It's a sample driver template.
Yep.
> Those /* goto error path */ lines are for
> driver writers that use this to figure out
> what to do.
Still, it's nice if a sample driver has correct error handling.
Just comments are not good enough as guidance for some people ;-)
> The second return is not correct as it would
> not free the first alloc'd block.
Indeed. Better do it right.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2014-06-21 20:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-21 13:17 [PATCH] video: fbdev: skeletonfb.c: Adding code to managing allocation error Rickard Strandqvist
2014-06-21 13:58 ` Joe Perches
2014-06-21 20:48 ` Geert Uytterhoeven [this message]
2014-06-21 21:32 ` Rickard Strandqvist
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='CAMuHMdVJ=sA7ixyA+4BSffD1fzWOMwGivEQGZ+UN437VTw_xpw@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=daniel.vetter@ffwll.ch \
--cc=jg1.han@samsung.com \
--cc=joe@perches.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=tomi.valkeinen@ti.com \
/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).