diff options
Diffstat (limited to 'drivers/s390/char/tape_class.c')
-rw-r--r-- | drivers/s390/char/tape_class.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index b3569c82bb16..a5c68e60fcf4 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c | |||
@@ -44,11 +44,10 @@ struct tape_class_device *register_tape_dev( | |||
44 | int rc; | 44 | int rc; |
45 | char * s; | 45 | char * s; |
46 | 46 | ||
47 | tcd = kmalloc(sizeof(struct tape_class_device), GFP_KERNEL); | 47 | tcd = kzalloc(sizeof(struct tape_class_device), GFP_KERNEL); |
48 | if (!tcd) | 48 | if (!tcd) |
49 | return ERR_PTR(-ENOMEM); | 49 | return ERR_PTR(-ENOMEM); |
50 | 50 | ||
51 | memset(tcd, 0, sizeof(struct tape_class_device)); | ||
52 | strncpy(tcd->device_name, device_name, TAPECLASS_NAME_LEN); | 51 | strncpy(tcd->device_name, device_name, TAPECLASS_NAME_LEN); |
53 | for (s = strchr(tcd->device_name, '/'); s; s = strchr(s, '/')) | 52 | for (s = strchr(tcd->device_name, '/'); s; s = strchr(s, '/')) |
54 | *s = '!'; | 53 | *s = '!'; |