From: Pierre Morel Date: Mon, 21 Dec 2015 14:31:06 +0000 (+0100) Subject: s390/con3270: testing return kzalloc retval X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cf61393f4aa30f4c2a11cf2437d49ff4de6eb4fb;p=linux-beck.git s390/con3270: testing return kzalloc retval Return value from kzalloc is not tested and using a null pointer would lead to crash. Even if this should not happen at this moment, we may let the system decide if there is a better choice. Signed-off-by: Pierre Morel Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index 7c511add5aa7..4d7a9badfede 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -606,6 +606,8 @@ con3270_init(void) return PTR_ERR(rp); condev = kzalloc(sizeof(struct con3270), GFP_KERNEL | GFP_DMA); + if (!condev) + return -ENOMEM; condev->view.dev = rp; condev->read = raw3270_request_alloc(0);