From: Lebedev, Vladimir P Date: Tue, 5 Sep 2006 15:49:13 +0000 (+0400) Subject: ACPI: sbs: check for NULL device pointer X-Git-Tag: firefly_0821_release~32049^2~6^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=963497c12acb4d43caa9751b9291b014eea51a1a;p=firefly-linux-kernel-4.4.55.git ACPI: sbs: check for NULL device pointer Signed-off-by: Len Brown --- diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 62bef0b3b614..79f38f036775 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -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; }