From patchwork Sat Jun 19 20:58:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 12333189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 577DDC2B9F4 for ; Sat, 19 Jun 2021 20:58:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2ED3F6113C for ; Sat, 19 Jun 2021 20:58:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229477AbhFSVAe (ORCPT ); Sat, 19 Jun 2021 17:00:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbhFSVAd (ORCPT ); Sat, 19 Jun 2021 17:00:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0757C061574 for ; Sat, 19 Jun 2021 13:58:20 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id x24so22919636lfr.10 for ; Sat, 19 Jun 2021 13:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wNQEiv2Curb6hQD/17jdXcqsigImEVaW4IOMLah0Lcw=; b=PoelrXvj4GR3p5/XB+81VDEB9JZHX+USiBwBOzJ0FEAAJd3zUAaycqYXJfF8MShxEw 0TFE98sE3Me9eZM0FtLM3ch0qZ4yhxLuFVrJNSbBNjPCwhakBaGem+CILOLwV4HSVW4y tGhDNEA3oKGCIVDAD5ACvciLgsFzx/erHJFu9CVfYz0VL3sxo2KzXTuo23IR7waKgHRg LWq0wWA63BYr1PTjWUNErh6fMMTc0dJpW9e4QumTMSuNZ2EOB1UT0a/PyM4slUYRLUqI 0A02jkzkE9kEo/U15k3k2NeA5UufzajLOxaqQ/yoa+F/cZx6VplmUbnb9mLqogzimoun M8QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wNQEiv2Curb6hQD/17jdXcqsigImEVaW4IOMLah0Lcw=; b=dm5x6zkgXBDbw+GBxbCvXlXogh88138F4TgvgNcDSaVWzPLHY6FGqSc6PYlJW6CR9D jMmMNxp1N5XilA1zUon/yCCrSS+eMANIfjIDZxZJaj9vFGo1xvztnRBk2RLEbZtfrEcw O5tkQ7iVRupzBL6J+3cjKat+4//oq1onsPBANyhkHLPGX8S9ohyz0E2iPPPvtKIol2sO cL03sFZJt+rlPFZ2LVvsYwR43f7o8l0EnKeEyF+VdODdTNt9JK0v2Dp2Ln/3x4q9OWpT U1/vaP8dMPEQit73pIIkz38WzVge1GxDIVhlZrQ1BbCCE7TZVNDjnDco1shZ/l7J/uu+ lluw== X-Gm-Message-State: AOAM531KgTBejMTcOZ6gPMISmI9yXzvVkOk0w12jRpn7vqi57nwcVGdK zDXePk90FdZmQfzNOy8Aa0QTxz2d1cOumNczB8Rw+pPbzayROw== X-Google-Smtp-Source: ABdhPJxSMwWKM72MQmFJwvYjm7t7SzgevJ2VJbjtPRfWcIYUv2ryGLdNigH2iTYsSybuPuh5BiMUh5gJMwulvZkJxK4= X-Received: by 2002:ac2:419a:: with SMTP id z26mr8295111lfh.307.1624136298738; Sat, 19 Jun 2021 13:58:18 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sat, 19 Jun 2021 15:58:07 -0500 Message-ID: Subject: [PATCH][CIFS] Fix uninitialized variable in SMB1 POSIX query info error path To: CIFS Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fix SMB1 error path in cifs_get_file_info_unix. We were trying to fill in uninitialized file attributes in the error case. Addresses-Coverity: 139689 ("Uninitialized variables") From 209cef243f4548ded9349d5c699a73a2e48abd46 Mon Sep 17 00:00:00 2001 From: Steve French Date: Sat, 19 Jun 2021 15:53:18 -0500 Subject: [PATCH] cifs: fix SMB1 error path in cifs_get_file_info_unix We were trying to fill in uninitialized file attributes in the error case. Addresses-Coverity: 139689 ("Uninitialized variables") Signed-off-by: Steve French --- fs/cifs/inode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 1dfa57982522..f60f068d33e8 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -367,9 +367,12 @@ cifs_get_file_info_unix(struct file *filp) } else if (rc == -EREMOTE) { cifs_create_dfs_fattr(&fattr, inode->i_sb); rc = 0; - } + } else + goto cifs_gfiunix_out; rc = cifs_fattr_to_inode(inode, &fattr); + +cifs_gfiunix_out: free_xid(xid); return rc; } -- 2.30.2