[lkml]   [2014]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] video: fbdev: skeletonfb.c: Adding code to managing allocation error
On Sat, Jun 21, 2014 at 3:58 PM, Joe Perches <> 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.


> 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.



Geert Uytterhoeven -- There's lots of Linux beyond ia32 --

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

 \ /
  Last update: 2014-06-21 23:01    [W:0.057 / U:1.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site