Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sdmmc Avoid NULL deref when sdhc(4) attaches via con...
details: https://anonhg.NetBSD.org/src/rev/8e90dce0e1de
branches: trunk
changeset: 332237:8e90dce0e1de
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Fri Sep 12 19:47:40 2014 +0000
description:
Avoid NULL deref when sdhc(4) attaches via config_interrupts().
diffstat:
sys/dev/sdmmc/sdhc.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (29 lines):
diff -r 8cc51d15d969 -r 8e90dce0e1de sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c Fri Sep 12 19:45:16 2014 +0000
+++ b/sys/dev/sdmmc/sdhc.c Fri Sep 12 19:47:40 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdhc.c,v 1.45 2014/09/12 19:45:16 jakllsch Exp $ */
+/* $NetBSD: sdhc.c,v 1.46 2014/09/12 19:47:40 jakllsch Exp $ */
/* $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $ */
/*
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.45 2014/09/12 19:45:16 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.46 2014/09/12 19:47:40 jakllsch Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -1725,7 +1725,9 @@
* Wake up the sdmmc event thread to scan for cards.
*/
if (ISSET(status, SDHC_CARD_REMOVAL|SDHC_CARD_INSERTION)) {
- sdmmc_needs_discover(hp->sdmmc);
+ if (hp->sdmmc != NULL) {
+ sdmmc_needs_discover(hp->sdmmc);
+ }
if (ISSET(sc->sc_flags, SDHC_FLAG_ENHANCED)) {
HCLR4(hp, SDHC_NINTR_STATUS_EN,
status & (SDHC_CARD_REMOVAL|SDHC_CARD_INSERTION));
Home |
Main Index |
Thread Index |
Old Index