[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091210205623.GA29097@suse.de>
Date: Thu, 10 Dec 2009 12:56:23 -0800
From: Greg KH <gregkh@...e.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Kay Sievers <kay.sievers@...y.org>
Subject: Re: [patch] drivers: Fix bogus 0 error return in device_add()
On Thu, Dec 10, 2009 at 07:32:49PM -0000, Thomas Gleixner wrote:
> If device_add() is called with a device which does not have dev->p set
> up, then device_private_init() is called. If that succeeds, then the
> error variable is set to 0. Now if the dev_name(dev) check further
> down fails, then device_add() correctly terminates, but returns 0.
> That of course lets the driver progress. If later another driver uses
> this half set up device as parent then device_add() of the child
> device explodes and renders sysfs completely unusable.
>
> Set the error to -EINVAL if dev_name() check fails.
That's a good catch, thanks.
Is anything currently triggering this? Or did you just find it by
reading the code?
thanks,
greg k-h
--
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