Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3887328ybc; Thu, 21 Nov 2019 15:38:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzorhLH4vBRwUVlIKIDqyYjvrrr9MmK4S7GalzAXf4gJQ7UwGBtrFXubSLs7CeQ7vdOqNL1 X-Received: by 2002:a17:906:1d41:: with SMTP id o1mr17702451ejh.333.1574379536691; Thu, 21 Nov 2019 15:38:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574379536; cv=none; d=google.com; s=arc-20160816; b=toj59BiRDAwOVNcU59CSDx9edoUGtOOQm8K2DvSyvN2IVQQ+5uq4HoymvAxCL/ioRp 6qGRhiI+wzEqr98GTEKk/2hiJ+gdiSOx6+P6++W24Vika4321wDRk0dHvhYCWUTfjWtp 7jvOK26LL7H0HfmCPh0apMBptNy7tJWrRdQa2Ga0HmmtedkFvjvAdkiL/0p25JoCMAf0 PSBdYMasxIezs2ijNE286Tw4Nq73er9mTFljYVD6Xg/j3sb+U520/JTYe7fwxEWoPQM+ XrunjlN6zu7GPOssimdBuFNDcC82VYvH2Ps7pZ0rYpr7XLxPEi2ASa4pRg2hHo28bpZR OiJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=t6a0sjLvnDgHoEw0idUIgnLehOBj/4fwqzmdeKy0FO0=; b=DPxrnsOwmOCxxyWv3imSAcrEZDntf2E/XUha8NETMPAZOqM85yOxeguya2EfAlm+aS +b3jlGMLHN3hMj6TFInS3pAjI/IRh1XQNOfIAoWrUZhHZoBWU18KzXaudngj2Au36sz2 Gd3dyu0qeAOhLh4OxKA0OoLFIQfzosYZloViZ5ASzP+86A78QNlIPLfdOrIZ836FO4IR T2RVGCLd3N81pcU3yqNM/KAV5PvKltXoKLmP9n7NSttVDEuA5GeQhtyMO0f6Rjp+GOo6 /fOtiNR78KF5gTvugd4DB3v2VzwO4qFi76vV3RG25W7dZeGLB1XirvpduUrl90afRsg8 ZeoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16si433068ejb.55.2019.11.21.15.38.28; Thu, 21 Nov 2019 15:38:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbfKUXgw convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Nov 2019 18:36:52 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:47786 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfKUXgw (ORCPT ); Thu, 21 Nov 2019 18:36:52 -0500 Received: from marcel-macbook.holtmann.net (p4FF9F0D1.dip0.t-ipconnect.de [79.249.240.209]) by mail.holtmann.org (Postfix) with ESMTPSA id 05FE9CED19; Fri, 22 Nov 2019 00:45:58 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: [PATCH 1/2] Bluetooth: Move error check into the right if-clause From: Marcel Holtmann In-Reply-To: <20191121144138.GA70662@vaespino-mobl1.amr.corp.intel.com> Date: Fri, 22 Nov 2019 00:36:50 +0100 Cc: linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <1ACA0CFD-B0A2-41D9-9AB3-295DE534511B@holtmann.org> References: <20191121075130.92705-1-marcel@holtmann.org> <20191121144138.GA70662@vaespino-mobl1.amr.corp.intel.com> To: Johan Hedberg X-Mailer: Apple Mail (2.3601.0.10) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Johan, >> The if-clause for hdev->setup should also include the error handling >> since that is where the error really comes from. The code currently >> works correctly since ret=0 is assigned early on, but it is a lot >> harder to read and understand. >> >> Signed-off-by: Marcel Holtmann >> --- >> net/bluetooth/hci_core.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) > > Both patches in this set have been applied to bluetooth-next. Thanks. so my cleanup patch was actually a mistake. In itself it was the right fix, but with the follow up patch, we actually want it that way to allow the invalid_bdaddr variable assignment to be done after hdev->setup. I posted a v2 now that fixes that. We need to do a push --force to fix this up. A follow up patch would cause a hard to track history. Regards Marcel