aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/monreader.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/monreader.c')
-rw-r--r--drivers/s390/char/monreader.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 5fd3ad867386..fb7bc9e5eebc 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -257,14 +257,13 @@ mon_alloc_mem(void)
257 int i,j; 257 int i,j;
258 struct mon_private *monpriv; 258 struct mon_private *monpriv;
259 259
260 monpriv = kmalloc(sizeof(struct mon_private), GFP_KERNEL); 260 monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
261 if (!monpriv) { 261 if (!monpriv) {
262 P_ERROR("no memory for monpriv\n"); 262 P_ERROR("no memory for monpriv\n");
263 return NULL; 263 return NULL;
264 } 264 }
265 memset(monpriv, 0, sizeof(struct mon_private));
266 for (i = 0; i < MON_MSGLIM; i++) { 265 for (i = 0; i < MON_MSGLIM; i++) {
267 monpriv->msg_array[i] = kmalloc(sizeof(struct mon_msg), 266 monpriv->msg_array[i] = kzalloc(sizeof(struct mon_msg),
268 GFP_KERNEL); 267 GFP_KERNEL);
269 if (!monpriv->msg_array[i]) { 268 if (!monpriv->msg_array[i]) {
270 P_ERROR("open, no memory for msg_array\n"); 269 P_ERROR("open, no memory for msg_array\n");
@@ -272,7 +271,6 @@ mon_alloc_mem(void)
272 kfree(monpriv->msg_array[j]); 271 kfree(monpriv->msg_array[j]);
273 return NULL; 272 return NULL;
274 } 273 }
275 memset(monpriv->msg_array[i], 0, sizeof(struct mon_msg));
276 } 274 }
277 return monpriv; 275 return monpriv;
278} 276}