提交 39adb4e7 编写于 作者: M Mauro Carvalho Chehab

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: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 f67449fd
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册