mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 17:43:59 +00:00
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>
This commit is contained in:
parent
f67449fdba
commit
39adb4e739
@ -953,6 +953,8 @@ struct i2c_client *dvb_module_probe(const char *module_name,
|
|||||||
struct i2c_board_info *board_info;
|
struct i2c_board_info *board_info;
|
||||||
|
|
||||||
board_info = kzalloc(sizeof(*board_info), GFP_KERNEL);
|
board_info = kzalloc(sizeof(*board_info), GFP_KERNEL);
|
||||||
|
if (!board_info)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
strlcpy(board_info->type, name, I2C_NAME_SIZE);
|
strlcpy(board_info->type, name, I2C_NAME_SIZE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user