Re: [PATCH] Driver Core patches for 2.6.10-rc1

From: Pozsar Balazs
Date: Mon Nov 01 2004 - 19:09:57 EST


On Mon, Nov 01, 2004 at 01:57:56PM -0800, Greg KH wrote:
> diff -Nru a/fs/sysfs/bin.c b/fs/sysfs/bin.c
> --- a/fs/sysfs/bin.c 2004-11-01 13:37:18 -08:00
> +++ b/fs/sysfs/bin.c 2004-11-01 13:37:18 -08:00
> @@ -160,24 +160,26 @@
> {
> struct dentry * dentry;
> struct dentry * parent;
> + umode_t mode = (attr->attr.mode & S_IALLUGO) | S_IFREG;
^^^^^^^^^^^^^^^
> int error = 0;
>
> - if (!kobj || !attr)
> - return -EINVAL;
> + BUG_ON(!kobj || !kobj->dentry || !attr);
^^^^^

attr is already dereferenced, maybe this check should be moved before
it.



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