[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1261517116.2101.2.camel@yio.site>
Date: Tue, 22 Dec 2009 22:25:16 +0100
From: Kay Sievers <kay.sievers@...y.org>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/27] Driver core: devtmpfs: prevent concurrent
subdirectory creation and removal
On Tue, 2009-12-22 at 20:56 +0200, Kirill A. Shutemov wrote:
> On Tue, Dec 22, 2009 at 6:57 PM, Kay Sievers <kay.sievers@...y.org> wrote:
> > On Tue, Dec 22, 2009 at 15:10, Kirill A. Shutemov <kirill@...temov.name> wrote:
> >> On Mon, Dec 21, 2009 at 4:37 PM, Kay Sievers <kay.sievers@...y.org> wrote:
> >>> On Mon, Dec 21, 2009 at 14:37, Kirill A. Shutemov <kirill@...temov.name> wrote:
> >>>> v2.6.33-rc1-96-gdd59f6c:
> >>>> I guess it can be related to this commit.
> >>>
> >>> The fix is already pending here:
> >>> http://patchwork.kernel.org/patch/68337/
> >>
> >> One more problem: you don't unlock dirlock if kstrdup() failed.
> >
> > Oh right, will send a fix tomorrow.
>
> Reported-by Kirill A. Shutemov <kirill@...temov.name>
Thanks!
Kay
From: Kay Sievers <kay.sievers@...y.org>
Subject: devtmpfs: unlock mutex in case of string allocation error
Reported-by: Kirill A. Shutemov <kirill@...temov.name>
Signed-off-by: Kay Sievers <kay.sievers@...y.org>
---
drivers/base/devtmpfs.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -101,8 +101,10 @@ static int create_path(const char *nodep
/* parent directories do not exist, create them */
path = kstrdup(nodepath, GFP_KERNEL);
- if (!path)
- return -ENOMEM;
+ if (!path) {
+ err = -ENOMEM;
+ goto out;
+ }
s = path;
for (;;) {
s = strchr(s, '/');
@@ -117,6 +119,7 @@ static int create_path(const char *nodep
}
kfree(path);
}
+out:
mutex_unlock(&dirlock);
return err;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists