diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-03-22 16:01:11 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-03-22 16:01:33 +0300 |
commit | 39adb4e739050dcdb74c3465d261de8de5f224b7 (patch) | |
tree | 11221d22d8bc5c29937e1e2558a728cc4f2e76ec /drivers/media/dvb-core | |
parent | f67449fdba3b9dbdd340d8cbf17dfa711d5bd2fb (diff) | |
download | linux-39adb4e739050dcdb74c3465d261de8de5f224b7.tar.xz |
media: dvbdev: handle ENOMEM error at dvb_module_probe()
If allocation of struct board_info fails, return NULL from
dvb_module_probe().
Fix this warning:
drivers/media/dvb-core/dvbdev.c:958 dvb_module_probe() error: potential null dereference 'board_info'. (kzalloc returns null)
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r-- | drivers/media/dvb-core/dvbdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index cf747d753a79..787fe06df217 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -953,6 +953,8 @@ struct i2c_client *dvb_module_probe(const char *module_name, struct i2c_board_info *board_info; board_info = kzalloc(sizeof(*board_info), GFP_KERNEL); + if (!board_info) + return NULL; if (name) strlcpy(board_info->type, name, I2C_NAME_SIZE); |