Re: [PATCH 1/2] cpqfc: fix for "Using too much stach" in 2.6 kernel

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

 



On 8/4/05, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote:
> On 8/4/05, Saripalli, Venkata Ramanamurthy (STSD) <saripalli@xxxxxx> wrote:
> > Patch 1 of 2
> >
> > This patch fixes the "#error this is too much stack" in 2.6 kernel.
> > Using kmalloc to allocate memory to ulFibreFrame.
> >
> [snip]
> >            if( fchs->pl[0] == ELS_LILP_FRAME)
> >           {
> > +           kfree(ulFibreFrame);
> >              return 1; // found the LILP frame!
> >           }
> >           else
> >           {
> > +           kfree(ulFibreFrame);
> >             // keep looking...
> >           }
> 
> The first thing you do in either branch is to call
> kfree(ulFibreFrame); , so instead of having the call in both branches
> you might as well just have one call before the if().  Ohh and this
> looks like it could do with a CodingStyle cleanup as well.
> 
> kfree(ulFibreFrame);
> if (fchs->pl[0] == ELS_LILP_FRAME)
>         return 1; /* found the LILP frame! */
> /* keep looking */

Whoops, as Rolf Eike Beer pointed out to me, I snipped one line too many. 
  fchs = (TachFCHDR_GCMND*)ulFibreFrame;
So, the kfree inside each branch is correct. Freeing it just before
the if would be wrong.
Sorry about that.

-- 
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux