Re: [PATCH] Use of getblk differs between locations

From: Jan Hudec (bulb_at_ucw.cz)
Date: 10/11/05

  • Next message: Nimrod Gutman: "Re: is this u mail...."
    Date:	Tue, 11 Oct 2005 14:35:35 +0200
    To: Glauber de Oliveira Costa <glommer@br.ibm.com>
    
    
    

    On Mon, Oct 10, 2005 at 21:40:43 -0300, Glauber de Oliveira Costa wrote:
    > [...]
    > In the code you commented, I thought that we get the same case testing
    > from or to conditions, and thus, it would be correct to threat them in
    > the same way.

    In that code (below), the first test can safely just return. But the
    second has to undo the first call before returning. When you test new,
    the bh is already non-null. So you must release it.

    > [...]
    >
    > On Tue, Oct 11, 2005 at 01:05:03AM +0100, Al Viro wrote:
    > > On Mon, Oct 10, 2005 at 09:07:34PM -0300, Glauber de Oliveira Costa wrote:
    > > > if (!bh)
    > > > return -EIO;
    > > > new = sb_getblk(sb, to);
    > > > + if (!new)
    > > > + return -EIO;
    > >
    > > You've just introduced a leak here, obviously.
    > >
    > > Please, read the code before "fixing" that stuff; slapping returns at random
    > > and hoping that it will help is not a good way to deal with that - the only
    > > thing you achieve is hiding the problem.
    > >
    > > The same goes for the rest of patch - in each case it's not obvious that your
    > > changes are correct.

    --
    						 Jan 'Bulb' Hudec <bulb@ucw.cz>
    
    

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/



  • Next message: Nimrod Gutman: "Re: is this u mail...."

    Relevant Pages

    • Re: Announce: Swsusp-2.0-2.6-alpha1
      ... iain d broadfoot wrote: ... >> I'm pleased to be able to announce the first test release of a port of ... but no other keys have any effect. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Announce: Swsusp-2.0-2.6-alpha1
      ... On Sat, 2003-10-25 at 10:12, Nigel Cunningham wrote: ... > I'm pleased to be able to announce the first test release of a port of ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Off-by-one bug at unix_mkname ?
      ... it seems you're right, or the first test in the function is wrong, so ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: BK kernel workflow
      ... BK is hiding from you of course we would provide that information. ... > Does that mean you don't mind if someones export the changeset information ... > it still contained information about renames) plus some useful identifiers ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Full specifications available for RealTek 8180 wireless chipset
      ... since you seem to imply that people inside RealTek might "leak" ... >> the code or release the chipset specifications to the community. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)