mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-29 23:24:11 +08:00
extcon: cros-ec: Fix a potential NULL pointer dereference
Return -ENOMEM in case of memory allocation failure. This avoids a NULL
pointer dereference.
Fixes: c698316661
("extcon: cros-ec: Add extcon-cros-ec driver to support display out")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
This commit is contained in:
parent
5c27036d2b
commit
1cf76c4eeb
@ -68,6 +68,8 @@ static int cros_ec_pd_command(struct cros_ec_extcon_info *info,
|
||||
int ret;
|
||||
|
||||
msg = kzalloc(sizeof(*msg) + max(outsize, insize), GFP_KERNEL);
|
||||
if (!msg)
|
||||
return -ENOMEM;
|
||||
|
||||
msg->version = version;
|
||||
msg->command = command;
|
||||
|
Loading…
Reference in New Issue
Block a user