From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F06BF17A2FB for ; Sun, 25 Jan 2026 13:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769347202; cv=none; b=n3Z3aWudjzjfW7d9K6vY4Qo0NG059ewRu/w3poEwHF1bT9g06eEjwxfkUc0HA3FxDtQE7pbk/lurWVsRImVIWlgbd3w6dx3NbtTrx3bHGdUr5jleBKJ43tKExWyveVbnURREGxcKQ8eCiX1yM1spp5Nq7O5rqMRq7jxSSWbVqEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769347202; c=relaxed/simple; bh=vpxhCrsQUcVtUy4RzfsZPH4BtUUPocAPPs1AoXc4fH4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XYPvCiVzmwQcEPW20xZioGw9yz3x5iB+fcu9FF9x7zcFKxv6mTTk3KRQrASIy3sqDKWDn6cjHGLaioFPVb5aGX9TVD27EyZZy/ZqV2JCFkZ3FXtcZFC7UG92J8NiGCcgW0X+QGUmiu1NuRKmuE90UR1mJldLomSsbQtIKk3tMvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AYcIcZHG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AYcIcZHG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EF98C4CEF1; Sun, 25 Jan 2026 13:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769347201; bh=vpxhCrsQUcVtUy4RzfsZPH4BtUUPocAPPs1AoXc4fH4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AYcIcZHGjlY3NyHcMDpJzQHXaZouK5uHKAPiYSuws2vEuwBRq8+YAwxcz3Ad5rTMc 14VbdqaPHobeyynpKabMZQYQFlpow9EUzuC5X4adJVgrhrZgLYRc5jwpjBXAj3m7dK 1bMG9JjOEnj9g5x7WRNUmnUx5Mi1JVzgBMNGq/0TqWsm/2h6jRXkxb0bdiC6QDoXt3 OtMn6LzMcngNoXFVHGBRzbc3cB3FIen1BKDGZbSPsKqeoISqkzjocsor+adPVvuD50 bNQ9hZRo7T532dBxNttXLbQA7NgOWafzAtT9AbRi7m5EIYPAfXMumWcF1KuYsfQvYs ZRyzs+82jls9g== Date: Sun, 25 Jan 2026 15:19:56 +0200 From: Leon Romanovsky To: Pavan Chebbi Cc: jgg@ziepe.ca, michael.chan@broadcom.com, linux-kernel@vger.kernel.org, dave.jiang@intel.com, saeedm@nvidia.com, Jonathan.Cameron@huawei.com, gospo@broadcom.com, selvin.xavier@broadcom.com, kalesh-anakkur.purayil@broadcom.com Subject: Re: [PATCH fwctl 4/5] fwctl/bnxt_fwctl: Add bnxt fwctl device Message-ID: <20260125131956.GC13967@unreal> References: <20260118123401.3188438-1-pavan.chebbi@broadcom.com> <20260118123401.3188438-5-pavan.chebbi@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260118123401.3188438-5-pavan.chebbi@broadcom.com> On Sun, Jan 18, 2026 at 04:34:00AM -0800, Pavan Chebbi wrote: > Create bnxt_fwctl device. This will bind to bnxt's aux device. > On the upper edge, it will register with the fwctl subsystem. > It will make use of bnxt's ULP functions to send FW commands. > > Reviewed-by: Andy Gospodarek > Reviewed-by: Dave Jiang > Signed-off-by: Pavan Chebbi > --- > MAINTAINERS | 6 + > drivers/fwctl/Kconfig | 11 + > drivers/fwctl/Makefile | 1 + > drivers/fwctl/bnxt/Makefile | 4 + > drivers/fwctl/bnxt/main.c | 416 ++++++++++++++++++++++++++++++++++++ > include/uapi/fwctl/bnxt.h | 64 ++++++ > include/uapi/fwctl/fwctl.h | 1 + > 7 files changed, 503 insertions(+) > create mode 100644 drivers/fwctl/bnxt/Makefile > create mode 100644 drivers/fwctl/bnxt/main.c > create mode 100644 include/uapi/fwctl/bnxt.h <...> > +static void *bnxtctl_fw_rpc(struct fwctl_uctx *uctx, > + enum fwctl_rpc_scope scope, > + void *in, size_t in_len, size_t *out_len) > +{ > + struct bnxtctl_dev *bnxtctl = > + container_of(uctx->fwctl, struct bnxtctl_dev, fwctl); > + struct bnxt_aux_priv *bnxt_aux_priv = bnxtctl->aux_priv; > + void *dma_virt_addr[MAX_NUM_DMA_INDICATIONS]; > + dma_addr_t dma_addr[MAX_NUM_DMA_INDICATIONS]; > + struct fwctl_dma_info_bnxt *dma_buf = NULL; > + struct device *dev = &uctx->fwctl->dev; > + struct fwctl_rpc_bnxt *msg = in; > + struct bnxt_fw_msg rpc_in; > + int i, rc, err = 0; > + > + rpc_in.msg = memdup_user(u64_to_user_ptr(msg->req), msg->req_len); > + if (IS_ERR(rpc_in.msg)) > + return rpc_in.msg; > + > + if (!bnxtctl_validate_rpc(bnxt_aux_priv->edev, &rpc_in, scope)) { > + err = -EPERM; > + goto free_msg_out; > + } <...> > +free_msg_out: > + kfree(rpc_in.msg); > + > + if (err) { > + kfree(rpc_in.resp); You are kfree junk address here. Thanks > + return ERR_PTR(err); > + } > + > + return rpc_in.resp; > +} > +