drivers/base/class.c: fix swapped memset() arguments
diff mbox series

Message ID 20050912135847.GA9673@mipter.zuzino.mipt.ru
State New, archived
Headers show
Series
  • drivers/base/class.c: fix swapped memset() arguments
Related show

Commit Message

Alexey Dobriyan Sept. 12, 2005, 1:58 p.m. UTC
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/base/class.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


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

Comments

Jiri Slaby Sept. 12, 2005, 6:23 p.m. UTC | #1
Alexey Dobriyan napsal(a):

>Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>---
>
> drivers/base/class.c |    2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
>--- linux-vanilla/drivers/base/class.c
>+++ linux-memset/drivers/base/class.c
>@@ -506,7 +506,7 @@ int class_device_add(struct class_device
> 			kobject_del(&class_dev->kobj);
> 			goto register_done;
> 		}
>-		memset(attr, sizeof(*attr), 0x00);
>+		memset(attr, 0x00, sizeof(*attr));
> 		attr->attr.name = "dev";
> 		attr->attr.mode = S_IRUGO;
> 		attr->attr.owner = parent->owner;
>  
>
Consider use of kzalloc, some of latest git snapshot contains it yet.
Maybe you want to replace all occurences of memset in this source with 
that as I took a look.

Patch
diff mbox series

--- linux-vanilla/drivers/base/class.c
+++ linux-memset/drivers/base/class.c
@@ -506,7 +506,7 @@  int class_device_add(struct class_device
 			kobject_del(&class_dev->kobj);
 			goto register_done;
 		}
-		memset(attr, sizeof(*attr), 0x00);
+		memset(attr, 0x00, sizeof(*attr));
 		attr->attr.name = "dev";
 		attr->attr.mode = S_IRUGO;
 		attr->attr.owner = parent->owner;