[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190124142755.GA31059@bhar.linux>
Date: Thu, 24 Jan 2019 19:58:00 +0530
From: Bharath Vedartham <linux.bhar@...il.com>
To: jic23@...nel.org, knaack.h@....de, lars@...afoo.de,
pmeerw@...erw.net
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: iio: industrialio-core: add check when kzalloc fails
add code to handle the case when kzalloc fails to allocate memory to dev
Signed-off-by: Bharath Vedartham <linux.bhar@...il.com>
---
drivers/iio/industrialio-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 4f5cd9f..93caa6b 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -1475,6 +1475,8 @@ struct iio_dev *iio_device_alloc(int sizeof_priv)
}
dev_set_name(&dev->dev, "iio:device%d", dev->id);
INIT_LIST_HEAD(&dev->buffer_list);
+ } else {
+ return NULL;
}
return dev;
--
2.7.4
Powered by blists - more mailing lists