From nobody Wed Feb 09 10:55:25 2022 X-Original-To: dev-commits-src-main@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 D6AD019A8BC7; Wed, 9 Feb 2022 10:55:25 +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 4JtxcF5Ypzz4RBc; Wed, 9 Feb 2022 10:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644404125; 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=axx+oObcr7rwRO2RPMyq2U3DZZK77EmHQ6ZzDkvSQhU=; b=jz4OWnbUvkDWgfTDRsEVogaFqgZ6qlRbc1gLWsRpya7PWSdsx/pWPIC/2SGJjfMWkEKF0F VrWtSwLuNRGjsKi1cRmAXmNdbSu5RHbTqU95cC8+F97CUSA8nxoAxeeqYhxg3vmzsMNU6U V2NPXl7YCi89aMMqd9lgEo7feXrWfrNN9WwOHz/M65qe/2/K3LAK0dxpPMRxXDI79ByuUh G/ABPtqq9nQZNEP5xBK3uJGE5RMCh4O78NtjJg2UtQ1/lFzXEPQcRnt9/soMXnohqWrOnh UTlEuuLFXJpQQGeJhrMNQXpbh/IFwE/xicApR5sUAHcTGE43jWk1+1HPkGYo0g== 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 9FD813E23; Wed, 9 Feb 2022 10:55:25 +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 219AtP7s098296; Wed, 9 Feb 2022 10:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 219AtPQX098295; Wed, 9 Feb 2022 10:55:25 GMT (envelope-from git) Date: Wed, 9 Feb 2022 10:55:25 GMT Message-Id: <202202091055.219AtPQX098295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 7bf31432fd03 - main - ocs_fc: Fix a possible Null pointer dereference List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bf31432fd03e2a5a815d1cc81de9a7b1ea3d3ca Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644404125; 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=axx+oObcr7rwRO2RPMyq2U3DZZK77EmHQ6ZzDkvSQhU=; b=kyVunjTebOXXI+wFRb/G4Hzl+RBhHDzwU8dDSe8Pkl84zleX6Kkyw3chtFa0/5jfHTwvpH YWPsxQ+GgqO/lpziaVncfCOlbuwhEqtrOJK6qbQ6rHrlvAcCBr2DHpdc7uIeI0TSQKgJ1G 0mUUqCZ6CDafPuJquhSy6L4d9Q/dLESFR4aFhr+XczplrCPzOrSPB2XbecQ1BXcMUhA1va 3YlF76h+9yzn1tg87BMn1rcrBkIUMiyCDdPt2Uocg6lo/DpDfbe49GR0KKUzTm2dkHL56Y 8z+GBS5UbVWlgwZ/jWvXV8Hu4MDchg1BcstQN97FlzTveaDWpEFUzIUCnPl+0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644404125; a=rsa-sha256; cv=none; b=t6jkiXeIGjX+sfB0grTTEnuMDBIPJQv5GmLfje64wRQIBofE47cyY8bKAyWJIahRfVVoXT UFfrpJMsijxqmHa/EXv0VtrQ20P/GijL8p2AIRefDBLtn9wkexirolct9dO+aejsPvvccB /CT3uOko4bXaBvsVgGH7yuU9i3PX41sNyI+0iDBiKZu+PgWY0JBfPQ3bHOGZ2az1EZOTBH LaPC1lNa5LN+5nwJM6upLeCijdnOIGkTbsaPOVWDX7Ij4SunFLWvOmka0UsFkXHO68fD0H VtEaXc6DGn1BaP39c6nOMrDT8lfuSQldfzPG9yNd8vRPb3TBEve4PpttsrgW6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=7bf31432fd03e2a5a815d1cc81de9a7b1ea3d3ca commit 7bf31432fd03e2a5a815d1cc81de9a7b1ea3d3ca Author: Ram Kishore Vegesna AuthorDate: 2022-02-09 10:14:12 +0000 Commit: Ram Kishore Vegesna CommitDate: 2022-02-09 10:48:21 +0000 ocs_fc: Fix a possible Null pointer dereference Fix a possible Null pointer dereference in ocs_hw_get_profile_list_cb() PR: 261453 Reported by: lwhsu MFC after: 3 days --- sys/dev/ocs_fc/ocs_hw.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c index c14b7a97fd97..8fcf31b21514 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -7581,6 +7581,11 @@ ocs_hw_get_profile_list_cb(ocs_hw_t *hw, int32_t status, uint8_t *mqe, void *arg int num_descriptors; list = ocs_malloc(hw->os, sizeof(ocs_hw_profile_list_t), OCS_M_ZERO); + if (list == NULL) { + ocs_log_err(hw->os, "failed to malloc list\n"); + return OCS_HW_RTN_NO_MEMORY; + } + list->num_descriptors = response->profile_descriptor_count; num_descriptors = list->num_descriptors;