提交 31f00759 编写于 作者: D Dan Carpenter 提交者: Matthew Garrett

sony-laptop: handle allocation failures

Return -ENOMEM if kzalloc() fails.  The callers already handle error
returns.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NMatthew Garrett <mjg@redhat.com>
上级 7227dedb
......@@ -768,6 +768,8 @@ static int sony_nc_handles_setup(struct platform_device *pd)
int result;
handles = kzalloc(sizeof(*handles), GFP_KERNEL);
if (!handles)
return -ENOMEM;
sysfs_attr_init(&handles->devattr.attr);
handles->devattr.attr.name = "handles";
......@@ -1458,6 +1460,8 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd)
return 0;
kbdbl_handle = kzalloc(sizeof(*kbdbl_handle), GFP_KERNEL);
if (!kbdbl_handle)
return -ENOMEM;
sysfs_attr_init(&kbdbl_handle->mode_attr.attr);
kbdbl_handle->mode_attr.attr.name = "kbd_backlight";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册