[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK+_RL=C2u07fL+OS7nW5bx1KR=-_wTfECi0e8xBtvxoF_czpw@mail.gmail.com>
Date: Sun, 7 Jan 2024 15:23:32 +0000
From: Tigran Aivazian <aivazian.tigran@...il.com>
To: "Christian A. Ehrhardt" <lk@...e.de>
Cc: Xiaochen Zou <xzou017@....edu>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs/bfs: Null check to prevent null-ptr-deref bug
Hi,
On Sat, 6 Jan 2024 at 18:54, Christian A. Ehrhardt <lk@...e.de> wrote:
> > > if (!bh)
> > > return -EIO;
> > > new = sb_getblk(sb, to);
> > > + if (unlikely(!new))
> > > + return -ENOMEM;
>
> What's with the bh in this case? Wouldn't we need a brelse or something?
Oh sorry, mea culpa et senecta :) Since the data has been read into bh
then I suppose we need bforget(bh) rather than brelse(bh) before
returning -ENOMEM above.
Kind regards,
Tigran
Powered by blists - more mailing lists