From patchwork Fri Mar 17 11:15:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volker Lendecke X-Patchwork-Id: 1758203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (3072-bit key; secure) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=Rjwgz9zi; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PdM4x6ZZlz247R for ; Fri, 17 Mar 2023 22:16:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229590AbjCQLP4 (ORCPT ); Fri, 17 Mar 2023 07:15:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjCQLPz (ORCPT ); Fri, 17 Mar 2023 07:15:55 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 294D43B21D for ; Fri, 17 Mar 2023 04:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-Id:Date:Cc:To:From; bh=BzNjhH9ScODyxjxIjrrBhUvgn9xEEkoimnXm3TQJdAo=; b=Rjwgz9zizpAeOU35055wAln+L2 44huYE/+zO0ObjYnX0RtPlwkX5MaPRpQ2J0O3apNC/+2khwV8+4828H2WaMqp62h8mFawkum4ZK5E sl5IyK4y8wxgCsOGZOrP3Y0YwkLuM4Y5J9SpXzb+I73LHouNmEKbUAs5Nhq8rpt73LSQB1ww356+J vAk2FB2MxveZegO/HdOjRAzzjEVfACQwrahdD4voEZI9DoCMTiqVmU8KW2NxZrITQTzkBxHgTF+Gh oXKzBtZZksfL75Usc6U1wzW6o2DBgNoQqOQ5wsNJzPppq1LlMEFkyXkX5RXOOSxqMyFuydkRIFzI5 nQTcMMD0vrrtiitL0pajOTqy02rq+Ajq7QGrQpCgrQ3gLl8898N0dVhWYbg/bH8YNDKtpmIUPbmDL 2EVV6satvDWCJ+NLhgqz7aj4yngj/Nb1iWcfKZB9qXqP3kkQ85z5a76i4zXx3vOdvQA/OvD9XRa39 F8bDzoapxcd3FM8CMcn2txoW; Received: from [2a01:4f8:252:410e::177:224] (port=37520 helo=atb-devel-224..) by hr2.samba.org with esmtp (Exim) id 1pd83o-003p4x-6G; Fri, 17 Mar 2023 11:15:48 +0000 From: Volker Lendecke To: linux-cifs@vger.kernel.org Cc: Volker Lendecke Subject: [PATCH 3/7] cifs: Avoid a cast in add_posix_context() Date: Fri, 17 Mar 2023 11:15:24 +0000 Message-Id: <7344eac4bab0f3d162ca5a401d9620d468ea3292.1679051552.git.vl@samba.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org We have the correctly-typed struct smb2_create_req * available in the caller. Signed-off-by: Volker Lendecke --- fs/cifs/smb2pdu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index cebb8d9837d2..6b6790d8d0ee 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -795,9 +795,9 @@ create_posix_buf(umode_t mode) } static int -add_posix_context(struct kvec *iov, unsigned int *num_iovec, umode_t mode) +add_posix_context(struct smb2_create_req *req, + struct kvec *iov, unsigned int *num_iovec, umode_t mode) { - struct smb2_create_req *req = iov[0].iov_base; unsigned int num = *num_iovec; iov[num].iov_base = create_posix_buf(mode); @@ -2694,7 +2694,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode, if (tcon->posix_extensions) { /* resource #3: posix buf */ - rc = add_posix_context(iov, &n_iov, mode); + rc = add_posix_context(req, iov, &n_iov, mode); if (rc) goto err_free_req; pc_buf = iov[n_iov-1].iov_base; @@ -2863,7 +2863,7 @@ SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, cpu_to_le32(iov[n_iov-1].iov_len); } - rc = add_posix_context(iov, &n_iov, oparms->mode); + rc = add_posix_context(req, iov, &n_iov, oparms->mode); if (rc) return rc; }