Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31f00759 authored by Dan Carpenter's avatar Dan Carpenter Committed by Matthew Garrett
Browse files

sony-laptop: handle allocation failures



Return -ENOMEM if kzalloc() fails.  The callers already handle error
returns.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 7227dedb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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";