lkml.org 
[lkml]   [2011]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] Intel PTI implementaiton of MIPI 1149.7.
On Thu, 5 May 2011, J Freyensee wrote:

> On Sun, 2011-04-24 at 02:55 +0200, Jesper Juhl wrote:
...
> >
> > kbuff is a local variable. What's the point in assigning NULL to it just
> > before you return? Just get rid of that silly assignment.
>
> I err on the side of paranoia and default to attempting to use good
> programming practices and rather receiving comments like this, than the
> alternative where I should have assigned something to NULL/0 and I
> introduce a security flaw in the driver/kernel.
>

That is all well and good, but assigning to a local variable just before
it goes out of scope is utterly pointless. Nothing can access the variable
afterwards, so it's value is completely irrelevant at that point.

--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.



\
 
 \ /
  Last update: 2011-05-05 22:51    [W:0.060 / U:1.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site