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

Commit 963497c1 authored by Lebedev, Vladimir P's avatar Lebedev, Vladimir P Committed by Len Brown
Browse files

ACPI: sbs: check for NULL device pointer



Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent b4bd8c66
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1685,10 +1685,16 @@ static int acpi_sbs_add(struct acpi_device *device)

int acpi_sbs_remove(struct acpi_device *device, int type)
{
	struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device);
	struct acpi_sbs *sbs = NULL;
	int id;

	if (!device || !sbs) {
	if (!device) {
		return -EINVAL;
	}

	sbs = (struct acpi_sbs *)acpi_driver_data(device);

	if (!sbs) {
		return -EINVAL;
	}