[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2d1f0e1-9f0c-418c-ac6b-16ffbfee562d@kili.mountain>
Date: Thu, 30 Mar 2023 19:04:06 +0300
From: Dan Carpenter <error27@...il.com>
To: Takashi Iwai <tiwai@...e.de>
Cc: Mirsad Todorovac <mirsad.todorovac@....unizg.hr>,
Luis Chamberlain <mcgrof@...nel.org>,
linux-kselftest@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Russ Weight <russell.h.weight@...el.com>,
Tianfei zhang <tianfei.zhang@...el.com>,
Shuah Khan <shuah@...nel.org>,
Colin Ian King <colin.i.king@...il.com>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [BUG] [PATCH RFC v2] selftests/firmware: copious kernel memory
leaks in test_fw_run_batch_request()
On Thu, Mar 30, 2023 at 06:01:54PM +0200, Takashi Iwai wrote:
> On Thu, 30 Mar 2023 17:44:42 +0200,
> Dan Carpenter wrote:
> >
> > I admire your enthusiam. :) What about if we just did this? Does it
> > help with the leaks?
> >
> > regards,
> > dan carpenter
> >
> > diff --git a/lib/test_firmware.c b/lib/test_firmware.c
> > index 05ed84c2fc4c..626b836895f4 100644
> > --- a/lib/test_firmware.c
> > +++ b/lib/test_firmware.c
> > @@ -895,6 +895,9 @@ static ssize_t trigger_batched_requests_store(struct device *dev,
> >
> > mutex_lock(&test_fw_mutex);
> >
> > + if (test_fw_config->reqs)
> > + return -EBUSY;
> > +
>
> This leaves the mutex locked.
> It should be the following instead, I suppose?
>
> if (test_fw_config->reqs) {
> rc = -EBUSY;
> goto out_unlock;
> }
So embarrassing... Yes.
regards,
dan carpenter
Powered by blists - more mailing lists