From nobody Mon Feb 14 07:20:09 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 6FDEC1951372; Mon, 14 Feb 2022 07:20:09 +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 4JxwbY2kwcz3v9D; Mon, 14 Feb 2022 07:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644823209; 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=f16CAbOv2Hq5UUdLmchRmljsAVW71U1RzIuaGPiJ5sA=; b=djDV9QnY4AuBhnENm25fPKJimHNqn38Dvhi/m0B2wA5fmF470EfFZo81IvfTOStEuPjr75 6NkpMH8FsRIoAZMljn+W4sQ0rI0aeNhokMFXahgsP9eDOARXFyRLj2uIXekFnqgKnh0D+V JlZ84KwUKy/qxqsPULGKNuKOAgEv9uBsalzc3myJvJTac78mVG/4yyCJHZG1smXih/pNDB SCsQZ2gb8w6FTz0bbyy2gu0gITd+sczUfu5R9VSo/4THk/CtKv7LW3IItYpBbJbje4nSTZ TZ+QpwS4cTOo7D2CTvrG3uJnF3fz239KiN0nr1pT92vCeJbBP/HAhFnM7Qmttg== 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 3E535245B; Mon, 14 Feb 2022 07:20:09 +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 21E7K9VW035697; Mon, 14 Feb 2022 07:20:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21E7K9Uc035693; Mon, 14 Feb 2022 07:20:09 GMT (envelope-from git) Date: Mon, 14 Feb 2022 07:20:09 GMT Message-Id: <202202140720.21E7K9Uc035693@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: 2748f68db95e - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 2748f68db95e2e921814472f9c1b77ef49b8fde6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644823209; 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=f16CAbOv2Hq5UUdLmchRmljsAVW71U1RzIuaGPiJ5sA=; b=L6U+A+MrSLH/9z1K6vpVJ6RoZXSMWFoZoJOct8EsuNt4kGh5FMNYfOcgUUOQxatNkFQ3cT BbAYbmyt7CdymqNLldZ/9+nB7BxT8o1OEi5zpapBVnKLun3SY+aYWZU//Yj0YVnUq9G6wR 1DmFs4ort56hO+fHrifDz2SE9BXKPGar0CDWPjF6hEGpuRUQa+hEHyoloQ6wqAEjIyDc2n PDSpl7zu8jYlVX75VUck7nOA3IbNjm3ThnCd2tNOBUn1FuFkyeuqtEKml92jrEuiz5khF1 gbVdD8PZCz3MLK9LsC3bomrcJJOetbylKsUvJZUeM0U+RxKdB1h04LrB0JDG7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644823209; a=rsa-sha256; cv=none; b=ApA+GztrfCdaI4/eMfOjo7ekQ5FkyHMaUi+9n+cvb0lS8PM3NIFgcKwTU8+Yp5HBUrGNOG 5shumL+Exnbe8C1Qo0/wWT6vroW9Cmfc2u0awTZmXP0NsBQRZFqibCli5bM+rEdCUncBeL une3iiakDvWuPwGXZkcXUnlaqw7EHOmoYFli/GHYwe4Mmf7e3a4ZmKowkHGzcR5cWCAu5S 8h9tRZtUcjqv9uqDTGKo8vuRf+Hnh/dh9JsnH9W5JD3AROjJbhhIqHV51rJ5bK6ULDOfBX kpns8YIeoa+xldxdG/CGN+bYsV4oYT1RnPCI7biU0SjshTaxZQrTtqAynjCOzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=2748f68db95e2e921814472f9c1b77ef49b8fde6 commit 2748f68db95e2e921814472f9c1b77ef49b8fde6 Author: Ram Kishore Vegesna AuthorDate: 2022-02-09 10:14:12 +0000 Commit: Ram Kishore Vegesna CommitDate: 2022-02-14 07:12:55 +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 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;