Module Name: src Committed By: mlelstv Date: Tue May 8 03:27:17 UTC 2018
Modified Files: src/sys/dev/acpi: sdhc_acpi.c Log Message: Bail if we have a zero-length memory resource. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/sdhc_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/sdhc_acpi.c diff -u src/sys/dev/acpi/sdhc_acpi.c:1.4 src/sys/dev/acpi/sdhc_acpi.c:1.5 --- src/sys/dev/acpi/sdhc_acpi.c:1.4 Fri Feb 17 10:51:48 2017 +++ src/sys/dev/acpi/sdhc_acpi.c Tue May 8 03:27:17 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: sdhc_acpi.c,v 1.4 2017/02/17 10:51:48 nonaka Exp $ */ +/* $NetBSD: sdhc_acpi.c,v 1.5 2018/05/08 03:27:17 mlelstv Exp $ */ /* * Copyright (c) 2016 Kimihiro Nonaka <non...@netbsd.org> @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.4 2017/02/17 10:51:48 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.5 2018/05/08 03:27:17 mlelstv Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -168,6 +168,10 @@ sdhc_acpi_attach(device_t parent, device aprint_error_dev(self, "incomplete resources\n"); goto cleanup; } + if (mem->ar_length == 0) { + aprint_error_dev(self, "zero length memory resource\n"); + goto cleanup; + } sc->sc_memsize = mem->ar_length; if (bus_space_map(sc->sc_memt, mem->ar_base, sc->sc_memsize, 0,