From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 684D6C433EF for ; Mon, 25 Oct 2021 17:17:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E956360C49 for ; Mon, 25 Oct 2021 17:17:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E956360C49 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=chelsio.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc: To:From:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=eiT48sX2hOZ7cVyTPKIB6wsjL/4PCyiKnTHnmvTQoz8=; b=rLSKN0hXzKsXAiYiia8U6HXNRN ei0RPCnBfDt40+8s0h6eZjL2TlDu1zAlT+s1qoSB9oye0sZFpn1weVCkTTyMktw5T8cYRhHFHtzjW UeEg/DRjQ40BqgbYJsL/YHa6mvPE6qLPKRWwGOf4y67smWwzdfZKORfdgSSh/YSKt9z4F1sIKz61f DW9A3/BQjDY0K+uLZfy8r10pA+IY2czlD68USAk7vjM65vpv6VcP+IPH23direp6qG4qZ+fGrYqg6 kEfhwuKN0Vp8UazBDsHmOFegi+dZGTOfhC3T2lslIFLFjglu9Ba8VOLHFSk0IS1x/CHNMYT8MUxDN yzrWIs2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mf3bW-00HE7m-N3; Mon, 25 Oct 2021 17:17:46 +0000 Received: from stargate.chelsio.com ([12.32.117.8]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mf3bP-00HE6g-H5 for linux-nvme@lists.infradead.org; Mon, 25 Oct 2021 17:17:40 +0000 Received: from fcoe-test11.asicdesigners.com (fcoe-test11.blr.asicdesigners.com [10.193.185.180]) by stargate.chelsio.com (8.14.7/8.14.7) with ESMTP id 19PHHX4v001372; Mon, 25 Oct 2021 10:17:33 -0700 From: Varun Prakash To: sagi@grimberg.me, hch@lst.de Cc: linux-nvme@lists.infradead.org, varun@chelsio.com Subject: [PATCH] nvme-tcp: fix data digest pointer calculation Date: Mon, 25 Oct 2021 22:47:30 +0530 Message-Id: <1635182250-4006-1-git-send-email-varun@chelsio.com> X-Mailer: git-send-email 2.0.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_101739_617780_4363EDF8 X-CRM114-Status: GOOD ( 10.08 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org ddgst is of type __le32, &req->ddgst + req->offset increases &req->ddgst by 4 * req->offset, fix this by type casting &req->ddgst to u8 *. Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Signed-off-by: Varun Prakash --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 3c1c29d..22da856 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1051,7 +1051,7 @@ static int nvme_tcp_try_send_ddgst(struct nvme_tcp_request *req) int ret; struct msghdr msg = { .msg_flags = MSG_DONTWAIT }; struct kvec iov = { - .iov_base = &req->ddgst + req->offset, + .iov_base = (u8 *)&req->ddgst + req->offset, .iov_len = NVME_TCP_DIGEST_LENGTH - req->offset }; -- 2.0.2