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 2507D3B95FD; Mon, 23 Mar 2026 16:23:27 +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=1774283007; cv=none; b=UgW+2MF4av6T/Mx7cUTVjjsOCE23AcqfAJMGlTpOiYTStKh96vLu1fhFs66+92ouG8O4mpfDqvDbVVibVBx6/TEgLO9YiBOtGeXcDcPgR4gS7y8/J+6cm3OCyXJQ2NJAQgL8xC7cWs+ZTZJNQiJIKw7MShc2TG7Bx+muZwKTiYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774283007; c=relaxed/simple; bh=Ox8TFkaGWN3k2+XnV7xx1gr+ZzuDBHZXgeFELlGMKVQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nuj7yLe0XDj2++6tLO++8qqsJmkANCmn2pi3b+dw1B/4yj5lgRBHO9eRPWqUmboVFwurUHR1KDyV0M9UD/T2mkfoQnfBiX0Ar5daO+lIbIAmt9KtD62/MDVuDBN9YAQfGiq3Qc+FFKpE0M7rsyzRIM9aHfYL0/poL+B/zLinaT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rrOyQmjp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rrOyQmjp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9BCAC2BCB3; Mon, 23 Mar 2026 16:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774283007; bh=Ox8TFkaGWN3k2+XnV7xx1gr+ZzuDBHZXgeFELlGMKVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rrOyQmjplw7HW22d01HKe8rO4OhB7WuoD3NJB79bU88jmL6aivvC7JwA8zAsaSYmO BpfY3CrqQ5GduwNY8oHuMo/AQUeZnNXW8jZ1X3FZ6PJltX5gQa02gxSym83WlwNUSG QC1q9HrX+yKzvwPKZ7erhHmzCUTvQf9m8cTiXvk0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michal Schmidt , Arkadiusz Kubalewski , Simon Horman , Tony Nguyen , Sasha Levin , Sunitha Mekala Subject: [PATCH 6.1 365/481] ice: remove unused buffer copy code in ice_sq_send_cmd_retry() Date: Mon, 23 Mar 2026 14:45:47 +0100 Message-ID: <20260323134534.010611754@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134525.256603107@linuxfoundation.org> References: <20260323134525.256603107@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michal Schmidt [ Upstream commit 43a630e37e259fee83ab3fd769c42e2fed97ca81 ] The 'buf_cpy'-related code in ice_sq_send_cmd_retry() looks broken. 'buf' is nowhere copied into 'buf_cpy'. The reason this does not cause problems is that all commands for which 'is_cmd_for_retry' is true go with a NULL buf. Let's remove 'buf_cpy'. Add a WARN_ON in case the assumption no longer holds in the future. Signed-off-by: Michal Schmidt Reviewed-by: Arkadiusz Kubalewski Reviewed-by: Simon Horman Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Stable-dep-of: 326256c0a72d ("ice: reintroduce retry mechanism for indirect AQ") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ice/ice_common.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1596,7 +1596,6 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, { struct ice_aq_desc desc_cpy; bool is_cmd_for_retry; - u8 *buf_cpy = NULL; u8 idx = 0; u16 opcode; int status; @@ -1606,11 +1605,8 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, memset(&desc_cpy, 0, sizeof(desc_cpy)); if (is_cmd_for_retry) { - if (buf) { - buf_cpy = kzalloc(buf_size, GFP_KERNEL); - if (!buf_cpy) - return -ENOMEM; - } + /* All retryable cmds are direct, without buf. */ + WARN_ON(buf); memcpy(&desc_cpy, desc, sizeof(desc_cpy)); } @@ -1622,17 +1618,12 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, hw->adminq.sq_last_status != ICE_AQ_RC_EBUSY) break; - if (buf_cpy) - memcpy(buf, buf_cpy, buf_size); - memcpy(desc, &desc_cpy, sizeof(desc_cpy)); mdelay(ICE_SQ_SEND_DELAY_TIME_MS); } while (++idx < ICE_SQ_SEND_MAX_EXECUTE); - kfree(buf_cpy); - return status; }