summaryrefslogtreecommitdiff
path: root/drivers/s390/s390_rdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/s390_rdev.c')
-rw-r--r--drivers/s390/s390_rdev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/s390/s390_rdev.c b/drivers/s390/s390_rdev.c
index e3f64716982..3c7145d9f9a 100644
--- a/drivers/s390/s390_rdev.c
+++ b/drivers/s390/s390_rdev.c
@@ -27,10 +27,9 @@ s390_root_dev_register(const char *name)
if (!strlen(name))
return ERR_PTR(-EINVAL);
- dev = kmalloc(sizeof(struct device), GFP_KERNEL);
+ dev = kzalloc(sizeof(struct device), GFP_KERNEL);
if (!dev)
return ERR_PTR(-ENOMEM);
- memset(dev, 0, sizeof(struct device));
strncpy(dev->bus_id, name, min(strlen(name), (size_t)BUS_ID_SIZE));
dev->release = s390_root_dev_release;
ret = device_register(dev);