From nobody Sat Dec 31 12:07:07 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nkgpz69hbz2nJwJ; Sat, 31 Dec 2022 12:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nkgpz5dwgz4Hgr; Sat, 31 Dec 2022 12:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672488427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GsTp9qoi1sY4AMdvqbRLr4m6A4ZmQeSpaOm9FnGLL/w=; b=wYjEgqxm3UX/LdFXN8cWWKQ3ZSMaNqGkQaIPo9zp+IV6rH3L1jypc1MrIu/t8Ri3cvgv1z 7haqh3mxZfNlslKjLb3bymVcV6c8pYpWsGvl5Jajx42OoS36Iq34Vleh4LqyDJCw0zRy8w sx9rOZMGrvEeA/gR02cp2qag8bGRcCzeEN0WSCFNDl02QwKjN96rqLk9/lkzI93vNLF/ue aQE4yRF92nhmR2o/IobrYYAzqPJ1teMnlV8HTMPPjM6Ysb4LNn3BaAZhJjtUBsLUpmM44n xFcaT7B8T5KY3TzmbtPRrR3BgZG6D+9N48zN1FHKqj6UW4OfOF0EA8zMWeOXWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672488427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GsTp9qoi1sY4AMdvqbRLr4m6A4ZmQeSpaOm9FnGLL/w=; b=wIYcTZ8j2k6ymbT8R1I/CKUNAE5kSI7/s32qrYZkq96uDJBS2RdPmF5yYcnLlph7sBi3uY 6Htho/MFy5aFC+rpyYmT7MrsDaUYGE0p3evIfvE4+44dkNoOvg4blEQzCwgSrXs8hW9GQ0 vzUcPhKFYcNWd6hYvisEtwPlNX+/tY6xgUSMlh/2J/M4T0I/xgmvEnNuCBkAzw5lQEHlkX rSjQLi+GOiUH1c5vfUaXfAIzaqq0V5fCZD/cHelo7f4x+xmKP9b5uN+Cx9wslZJ407Wq/m o5Ys2zly5RrrfQ4VTQ+eyAshuFczw07qFiAgV8QpCj8UaF6dpkWXzsmx23tknw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672488427; a=rsa-sha256; cv=none; b=sZxXQFA6ackZRfehPr10yRPCmfGavvQo6lzzSEcnKS6mtVbnWiHsmxACKVaojlVLLrzu1e T0u1MtmHc6MRVRBQ+7ABmXwE+FVH3LtlKiVhz28oBolZ4yHiOSjgoojX6CrAeNpfMkEjrw IuBqjWAFe16ysuEuvlbn5klPrCO0B+9JNYHON5cL/8Phb9vDoNBcNHFS4AqGScexqCCJcg 6Th5O0byuVo1YskVSN+PQTsGaj9c4XodqmM0iip0CikkU4MFlo7woj5lnjtQivPzdUvai1 ZJYO3CH+id24IYujVsQOIEHMk9PlrLaP7oaXljd1BJL7Kgv1gThe3vzg2AXnGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Nkgpz4hTkznRV; Sat, 31 Dec 2022 12:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BVC77Tf041339; Sat, 31 Dec 2022 12:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BVC774M041338; Sat, 31 Dec 2022 12:07:07 GMT (envelope-from git) Date: Sat, 31 Dec 2022 12:07:07 GMT Message-Id: <202212311207.2BVC774M041338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 3946c7bdbd35 - stable/13 - debug_put_get: don't crash on null pointers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3946c7bdbd35617ab24716c4b1a0d413d9d3b2fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=3946c7bdbd35617ab24716c4b1a0d413d9d3b2fa commit 3946c7bdbd35617ab24716c4b1a0d413d9d3b2fa Author: Vincenzo Maffione AuthorDate: 2022-12-24 15:31:36 +0000 Commit: Vincenzo Maffione CommitDate: 2022-12-31 12:05:43 +0000 debug_put_get: don't crash on null pointers MFC after: 7 days (cherry picked from commit 92e8b4a6301cc4ff4481e981c95c5b30b2a44506) --- sys/dev/netmap/netmap_kern.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index a45a405d5163..848562d5d1f9 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1584,8 +1584,8 @@ void __netmap_adapter_get(struct netmap_adapter *na); #define netmap_adapter_get(na) \ do { \ struct netmap_adapter *__na = na; \ - nm_prinf("getting %p:%s (%d)", __na, (__na)->name, (__na)->na_refcount); \ __netmap_adapter_get(__na); \ + nm_prinf("getting %p:%s -> %d", __na, (__na)->name, (__na)->na_refcount); \ } while (0) int __netmap_adapter_put(struct netmap_adapter *na); @@ -1593,8 +1593,11 @@ int __netmap_adapter_put(struct netmap_adapter *na); #define netmap_adapter_put(na) \ ({ \ struct netmap_adapter *__na = na; \ - nm_prinf("putting %p:%s (%d)", __na, (__na)->name, (__na)->na_refcount); \ - __netmap_adapter_put(__na); \ + if (__na == NULL) \ + nm_prinf("putting NULL"); \ + else \ + nm_prinf("putting %p:%s -> %d", __na, (__na)->name, (__na)->na_refcount - 1); \ + __netmap_adapter_put(__na); \ }) #else /* !NM_DEBUG_PUTGET */