You need to sign in or sign up before continuing.
提交 8b9528a6 编写于 作者: M Mario Limonciello 提交者: Darren Hart (VMware)

platform/x86: dell-wmi-descriptor: check if memory was allocated

devm_kzalloc will return NULL pointer if no memory was allocated.
This should be checked.  This problem also existed when the driver
was dell-wmi.c.
Signed-off-by: NMario Limonciello <mario.limonciello@dell.com>
Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
上级 73ed298b
......@@ -121,6 +121,11 @@ static int dell_wmi_descriptor_probe(struct wmi_device *wdev)
priv = devm_kzalloc(&wdev->dev, sizeof(struct descriptor_priv),
GFP_KERNEL);
if (!priv) {
ret = -ENOMEM;
goto out;
}
priv->interface_version = buffer[2];
priv->size = buffer[3];
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册