From nobody Mon Feb 14 07:18:41 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 226AA1950E42; Mon, 14 Feb 2022 07:18:42 +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 4JxwYt0TXTz3th2; Mon, 14 Feb 2022 07:18:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644823122; 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=Ny9mUnLU4oAIBg7OXQ+aEKv3oEK4DnY9YZOBXkxgc84=; b=d7owIspe4El+yt9wwzu04jKjQQuJMmJXxXkRfWzIL1aqPL1fNNlRlY55zlHnrTFGoGMaMn kGeHrDd8/6afTeY4bpcRIzODBbDqUhYhsEk1eSO7yuhTNqWqTziWWuUDCOI0fCOlzd/AN3 c2OxnySE8sqjllLiYnGy3TN2Z1Q1lWRtC3PeycR+JYUGhS4j0zJbnmXhaZeiJpLhTsz18u ZWaH9aJ2WZt09/6FTiBQhXxOS2bSWCWyKdxJNGUoQs7ErdwzaxAGd2AaPWcYyN2aKCvzxK mmKOsjedLUi7Ga/GGp1J/7IQE2GboqnEp1/wrubsGjzNSj59FRozuGUf9izsHA== 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 E45FD254E; Mon, 14 Feb 2022 07:18:41 +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 21E7IfTR032483; Mon, 14 Feb 2022 07:18:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21E7Ifnh032482; Mon, 14 Feb 2022 07:18:41 GMT (envelope-from git) Date: Mon, 14 Feb 2022 07:18:41 GMT Message-Id: <202202140718.21E7Ifnh032482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 9199f5e0ba5c - stable/12 - ocs_fc: Fix a possible Null pointer dereference 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: ram X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9199f5e0ba5c20e2f170b549a743a550d9b38ec8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644823122; 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=Ny9mUnLU4oAIBg7OXQ+aEKv3oEK4DnY9YZOBXkxgc84=; b=n1BjEMbgyXDb3nWLQO1J+NfjELg0uKXvyaDm6UaRy1+tuvKfC3cgqB/Q3EzGj9EgE/rqqa eX06VwBeKjbcXRIP8GgWRNVD4yJaIEAK+5vuCbXzkJ/1MSuFBmX1SuuDQwajej6YVNaZ+q 2M4LofwbXI1I7lzVBV5KjYjdG4sVkkHE8JKy0erEJI5wv5yXKiOAlDU02R3U3ys4PrFlk4 wKoxy5STKKQ6ttK5FSJmaUbfVvqdiBshUc/dvnFy5oxoT9WTkvYdQiYQ6LDP/MqeqkNQnK up21E4LNlognr9EJ8JP36ZQe9dxTU0dfU1bphZ6qmUW9UvBg9v0/yUcQTDlu5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644823122; a=rsa-sha256; cv=none; b=onruEqpQ8jcLOS3NhyY4H5yKY7wMCu3Orc+EXi5+VAvTxivxMx1/uyM4nK3wyJJFPlTP12 Wsl2GcYumL8vNW3Uc2A6dGD8q/kEGRZQT/Ytyc0o3Ns7/kKUa5iHQidUn+ZEIv+W1MzFQw eMdVMqUvAAIpSKCupDSozRfygpmO305bE/dRmpNwLG2Ma8VS6j0eBy7KUqqpfjdmvj7Vn3 76ycAtQNrLPBODTuuXrEZb2odAFwCLOErNbLTHmDyk8YFe/wumqCPSEYF49zVNkWlEBDt4 7JUgfjgA2QyqATnNk4XbIn+fpDTlN+zEQUX4Qz6nuwWg0RKKgizXNIM2GZ/5yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=9199f5e0ba5c20e2f170b549a743a550d9b38ec8 commit 9199f5e0ba5c20e2f170b549a743a550d9b38ec8 Author: Ram Kishore Vegesna AuthorDate: 2022-02-09 10:14:12 +0000 Commit: Ram Kishore Vegesna CommitDate: 2022-02-14 07:11:11 +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 (cherry picked from commit 7bf31432fd03e2a5a815d1cc81de9a7b1ea3d3ca) --- 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 d9e8713765a2..7a623478c8aa 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -7614,6 +7614,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;