Skip to content

Commit 62f0a92

Browse files
committed
Avoid null pointer dereference. dc_sc may be null on early stage.
1 parent 43894be commit 62f0a92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sys/arch/hpcmips/dev/hpcfb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: hpcfb.c,v 1.30 2001/01/04 01:35:21 enami Exp $ */
1+
/* $NetBSD: hpcfb.c,v 1.31 2001/01/04 03:03:04 enami Exp $ */
22

33
/*-
44
* Copyright (c) 1999
@@ -46,7 +46,7 @@
4646
static const char _copyright[] __attribute__ ((unused)) =
4747
"Copyright (c) 1999 Shin Takemura. All rights reserved.";
4848
static const char _rcsid[] __attribute__ ((unused)) =
49-
"$Id: hpcfb.c,v 1.30 2001/01/04 01:35:21 enami Exp $";
49+
"$Id: hpcfb.c,v 1.31 2001/01/04 03:03:04 enami Exp $";
5050

5151
#include <sys/param.h>
5252
#include <sys/systm.h>
@@ -1264,7 +1264,7 @@ hpcfb_redraw(cookie, row, num, all)
12641264
return;
12651265
}
12661266
#endif /* HPCFB_JUMP */
1267-
if (dc->dc_sc->sc_mapping)
1267+
if (dc->dc_sc != NULL && dc->dc_sc->sc_mapping)
12681268
return;
12691269

12701270
if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)

0 commit comments

Comments
 (0)