Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1580241rdh; Mon, 25 Sep 2023 18:21:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCPavznvQRSO+wKnlsQiiShWjPxnsmLMmHsbHlAS65d/Re4g6dG98uVc6AG/n79roG43l1 X-Received: by 2002:a05:6870:179a:b0:1d5:8fa3:2ca6 with SMTP id r26-20020a056870179a00b001d58fa32ca6mr10741190oae.9.1695691270845; Mon, 25 Sep 2023 18:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695691270; cv=none; d=google.com; s=arc-20160816; b=heYw6ukWVKeYXPhe6thKMDBYPcN5qcg+917n3qRg5B/cmgxzfEPAGNkqxHFoNnrmZd JSGZFNR868U46JEwsYNl2GNJ2co9unOIfv0nBrNzmK14gIgvnsIiG7wJRLyUEUaWPJrg unI8oQ2AeYu5r1+U3w2wa9VqiBtyGfSIHCOHf8lHVOf+s3EQe7hj1kJkBAy+5bzSJ88h 2Rb3anF1F44Nd1QaDM6oF951dRXcJJvv3oUE5PQVuOOp7GbTnQzOPV4yh+ZHE1yZHRnv rdj0n7gwcErZ1a5mlEDs1GSyYEXDUaep+M+EUuC1Cz17k/kRIBGXBv7H1Tzehi6XfcbJ ugUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc:to :content-language:subject:user-agent:mime-version:date:message-id; bh=FIK7Ox7cxRI7QtC5/DLfBBzGFrAb+bZQURfguaNpbzo=; fh=Q6rAfIcqx8GqvyoonTXkmFxl/saJEI+vfeI8VHm/fnQ=; b=pTmmZugq/2pmnOBJlncmoASOjIYLMmdi+oS76Wlgw518iPs5MEWlsOOTESmUmBqdGb cgG7L0RQI1nLUz1GY8j+fgEYhZJft1we6sWXgcXFQBKI6rJOFFYBhNLE0wMrn42pVYkt xsw+M7Cm6fgIDtLg4gnXwdNWk/aP2rxeduDDXRmn0ZGJJYsEO1h3MA5EUC9YrG2GTUrz fw2MUfCI0eMoCfhJu9wW5EQSVADl7JgxkFhxXQZn75px0CetTM3bIbX5iKokix+aVJDe h7ikX/2sESXS41dqGIa/UyPiBYA7poJ23xNkUf0GUMjRGJSpb+wQbEKbIr7sbqc1krEp B8NQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i198-20020a639dcf000000b00537c6c285a0si11115638pgd.167.2023.09.25.18.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 18:21:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C15878246E2C; Mon, 25 Sep 2023 18:21:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233051AbjIZBVJ (ORCPT + 99 others); Mon, 25 Sep 2023 21:21:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231225AbjIZBVI (ORCPT ); Mon, 25 Sep 2023 21:21:08 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 5BDF910A; Mon, 25 Sep 2023 18:21:01 -0700 (PDT) Received: from [172.30.11.106] (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id 92714604DE905; Tue, 26 Sep 2023 09:20:58 +0800 (CST) Message-ID: <8c2f8756-be5c-e2b3-e1a8-d2751a4531a0@nfschina.com> Date: Tue, 26 Sep 2023 09:20:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] cifs: avoid possible NULL dereference Content-Language: en-US To: Dan Carpenter Cc: sfrench@samba.org, pc@manguebit.com, lsahlber@redhat.com, sprasad@microsoft.com, tom@talpey.com, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui In-Reply-To: <1ae6c204-ed00-4626-8246-32d66ae7e232@kadam.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 18:21:08 -0700 (PDT) On 2023/9/25 23:07, Dan Carpenter wrote: > On Mon, Sep 25, 2023 at 12:52:21PM +0800, Su Hui wrote: >> diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c >> index 2108b3b40ce9..37eed057ded0 100644 >> --- a/fs/smb/client/file.c >> +++ b/fs/smb/client/file.c >> @@ -4878,6 +4878,12 @@ void cifs_oplock_break(struct work_struct *work) >> struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, >> oplock_break); >> struct inode *inode = d_inode(cfile->dentry); >> + >> + if (!inode) { >> + cifs_dbg(FYI, "%s : failed to find inode\n", __func__); >> + return; >> + } >> + > Are we allowing this in the middle of the declaration block these days? Really sorry for this, I will modify it right now. Thanks for your reminder! Su Hui > >> struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); >> struct cifsInodeInfo *cinode = CIFS_I(inode); >> struct cifs_tcon *tcon; > > regards, > dan carpenter