diff options
author | Ed Maste <emaste@FreeBSD.org> | 2019-08-29 12:05:06 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2019-08-29 12:05:06 +0000 |
commit | 3485f4574e6e64ca0127685c260ed4726ee30b27 (patch) | |
tree | 7555c8e9ac151202f70f53a737ef96987f24d9f5 /sys/dev/vnic | |
parent | 0093b755a726648c6fb2d237000a9031fc6c67e9 (diff) | |
download | src-3485f4574e6e64ca0127685c260ed4726ee30b27.tar.gz src-3485f4574e6e64ca0127685c260ed4726ee30b27.zip |
vnic: avoid NULL deref in error case
Reported by: Dr Silvio Cesare of InfoSect
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=351603
Diffstat (limited to 'sys/dev/vnic')
-rw-r--r-- | sys/dev/vnic/thunder_bgx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/vnic/thunder_bgx.c b/sys/dev/vnic/thunder_bgx.c index ef0ca546ce9c..6d34b320ef51 100644 --- a/sys/dev/vnic/thunder_bgx.c +++ b/sys/dev/vnic/thunder_bgx.c @@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx, int lmac) bgx_idx += node * MAX_BGX_PER_CN88XX; bgx = bgx_vnic[bgx_idx]; - if (!bgx) { - device_printf(bgx->dev, - "BGX%d not yet initialized, ignoring DMAC addition\n", + if (bgx == NULL) { + printf("BGX%d not yet initialized, ignoring DMAC addition\n", bgx_idx); return; } |