From: Pierre Morel Date: Mon, 21 Dec 2015 14:31:06 +0000 (+0100) Subject: s390/con3270: testing return kzalloc retval X-Git-Tag: v5.15~14418^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf61393f4aa30f4c2a11cf2437d49ff4de6eb4fb;p=platform%2Fkernel%2Flinux-starfive.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 7c511ad..4d7a9bad 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);