Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp964100imm; Mon, 1 Oct 2018 23:47:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV60cKQoKSb6c2RnqWeRjHRH1dfdacqIo1sy+HuteV/pjVf7aQvZ2iPknZnmVbU8CWRnfKgPI X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr15478227plp.212.1538462831163; Mon, 01 Oct 2018 23:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538462831; cv=none; d=google.com; s=arc-20160816; b=m+vyihb8WUflTkrEiwSGhaT8IqIgnlluUGF0XhV0FRrxYrvlJ1di6vUgjlBIwGlZZe mQoDtwfGlgTRfA2S2f/3nD9H/O2QKl4Nvtg9P63k9ap4JFf7qZM7lAHvM5xQJpEe0OPB qlAHRbrh2AZzyx/OSFEe0kcv9QBoS9ATlv1KpPYWbmL4T6hubU8OBuSOmrWir2ITJTAT sA1XMdFtJudpji8p3aG6OE0gO4L4BvEhdogrBurhe69bjwVDsQgxicPrJJQEuKClFoWA yVk17SYucef0gwmtBqZH91LYF8rs2MydmrI8zmw+x1S4soJUsBW77nAaSrwOVLMd3OII JXag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-disposition:message-id:in-reply-to:references:subject:cc:to :from:date; bh=gR6uCTn7wN7MeZdWqv9idZcSfCqnuggNxYqVNpLIVns=; b=uiWTsha2x9aV6bU+0eTgAUWpw3bAD5IMhsfOtKOwaK5Mg5W/fanZqPX8IYkLu8tw/o MmIqMGXiV9laWGB+ulBd7OvwvuPMhf0/VHVmqqOJbBOgYAqFn8SMCzAgK4E0IHChMmqz dWF8R3kGVGCF0cORpRUAOVLoWHIguaD0ctC/SCDacLE7SV3g63/9JlJtlhppf6s4Aleq 6q8usdNCXxfV64dmo5cZ4ZAqnHfX3M/xX2P6oVp6cuQwwt631FlhaWf6acHgP7tDbXl8 NoXN4yDCWtZOrxqtWCNQDqwsndnOfuaxXOY+0gRAzt3MVYE1IjTQg7ZUa4y4F125AU1M CKqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si14817969plt.19.2018.10.01.23.46.56; Mon, 01 Oct 2018 23:47:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbeJBN2a convert rfc822-to-8bit (ORCPT + 99 others); Tue, 2 Oct 2018 09:28:30 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39562 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbeJBN2a (ORCPT ); Tue, 2 Oct 2018 09:28:30 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w926iJVm034115 for ; Tue, 2 Oct 2018 02:46:49 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mv10hn37t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 02 Oct 2018 02:46:48 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Oct 2018 07:46:46 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 2 Oct 2018 07:46:43 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w926kgmR62652492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Oct 2018 06:46:42 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 243DA42047; Tue, 2 Oct 2018 09:46:23 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C97724204B; Tue, 2 Oct 2018 09:46:22 +0100 (BST) Received: from osiris (unknown [9.152.212.171]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 2 Oct 2018 09:46:22 +0100 (BST) Date: Tue, 2 Oct 2018 08:46:40 +0200 From: Heiko Carstens To: Ursula Braun Cc: Dan Carpenter , kbuild@01.org, kbuild-all@01.org, davem@davemloft.net, netdev@vger.kernel.org, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, raspl@linux.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 2/5] net/smc: remove duplicate mutex_unlock References: <20180920091243.xgansymg6a4dfixg@mwanda> In-Reply-To: X-TM-AS-GCONF: 00 x-cbid: 18100206-0016-0000-0000-0000020D25A0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18100206-0017-0000-0000-000032646183 Message-Id: <20181002064640.GA16762@osiris> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-02_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=956 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810020069 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 01, 2018 at 05:22:22PM +0200, Ursula Braun wrote: > > > 3b2dec260 Hans Wippel 2018-05-18 1282 /* finish worker */ > > c69342ef9 Ursula Braun 2018-09-18 1283 if (!ism_supported) { > > c69342ef9 Ursula Braun 2018-09-18 1284 if (smc_listen_rdma_finish(new_smc, &cclc, local_contact)) > > c69342ef9 Ursula Braun 2018-09-18 1285 return; > > ^^^^^^ > > We need to mutex_unlock(&smc_create_lgr_pending); before the return. > > > > The smatch warning is not necessary, since the mutex_unlock(&smc_create_lgr_pending) > for this case is done within smc_listen_rdma_finish(). > > > c69342ef9 Ursula Braun 2018-09-18 1286 } > > 3b2dec260 Hans Wippel 2018-05-18 1287 smc_conn_save_peer_info(new_smc, &cclc); > > 3b2dec260 Hans Wippel 2018-05-18 1288 mutex_unlock(&smc_create_lgr_pending); > > 3b2dec260 Hans Wippel 2018-05-18 @1289 smc_listen_out_connected(new_smc); > > a046d57da Ursula Braun 2017-01-09 1290 } > > a046d57da Ursula Braun 2017-01-09 1291 > > > > --- > > 0-DAY kernel test infrastructure Open Source Technology Center > > https://lists.01.org/pipermail/kbuild-all Intel Corporation > > > > But you could argue the code confuses smatch and other readers. Thus I could improve > readability with a patch like this: Yes, please. > --- > net/smc/af_smc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > --- a/net/smc/af_smc.c > +++ b/net/smc/af_smc.c > @@ -1184,7 +1184,6 @@ static int smc_listen_rdma_finish(struct > return 0; > > decline: > - mutex_unlock(&smc_create_lgr_pending); > smc_listen_decline(new_smc, reason_code, local_contact); > return reason_code; > } The lonely mutex_unlock() also _looks_ like a bug ;)