From 9a1c2cfb58a9ae7026fac04af4206c2a74566ba9 Mon Sep 17 00:00:00 2001 From: Ryan Zezeski Date: Thu, 7 Feb 2019 13:13:45 -0700 Subject: [PATCH] OS-7564 panic in mac_hw_emul() Reviewed by: Robert Mustacchi Approved by: Jason King --- usr/src/uts/common/io/mac/mac_util.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usr/src/uts/common/io/mac/mac_util.c b/usr/src/uts/common/io/mac/mac_util.c index 111b323f8115..334d1d034bb3 100644 --- a/usr/src/uts/common/io/mac/mac_util.c +++ b/usr/src/uts/common/io/mac/mac_util.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2018 Joyent, Inc. + * Copyright 2019 Joyent, Inc. */ /* @@ -1239,9 +1239,19 @@ mac_hw_emul(mblk_t **mp_chain, mblk_t **otail, uint_t *ocount, mac_emul_t emul) */ mac_sw_lso(mp, emul, &tmphead, &tmptail, &tmpcount); + if (tmphead == NULL) { + /* mac_sw_lso() freed the mp. */ + mp = next; + continue; + } count += tmpcount; } else if ((flags & HCK_NEEDED) && (emul & MAC_HWCKSUM_EMULS)) { tmp = mac_sw_cksum(mp, emul); + if (tmp == NULL) { + /* mac_sw_cksum() freed the mp. */ + mp = next; + continue; + } tmphead = tmp; tmptail = tmp; count++;