summaryrefslogtreecommitdiff
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorPierre Morel <pmorel@linux.vnet.ibm.com>2015-12-21 15:31:06 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-12-30 10:34:33 +0100
commitcf61393f4aa30f4c2a11cf2437d49ff4de6eb4fb (patch)
treebbb6f174bb1c5db77d8b79cf56eab037851019fa /drivers/s390/char
parentc967e1df169d033b2da74e979e91b6e297e194fa (diff)
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 <pmorel@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/con3270.c2
1 files changed, 2 insertions, 0 deletions
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);