Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2249943rdb; Sun, 3 Dec 2023 08:37:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3xXTrvtkj5m3YEx59xSEwycN0uiyb2ySsLYEeLCOOa/rGSOABt0KxX69CPhv8Ci2VP5BW X-Received: by 2002:a05:6a20:2455:b0:18f:20be:7103 with SMTP id t21-20020a056a20245500b0018f20be7103mr1140753pzc.120.1701621462901; Sun, 03 Dec 2023 08:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701621462; cv=none; d=google.com; s=arc-20160816; b=WxmpmL2lO4VG65LGWmLInhf0jfu8WowjaRRqrr21SJTdWYidJRGIpksfHB0p+x3ihR A/4kKW3ic4+qeQTkBfb+tlOkWCg3qk+rgekEUYfbItTNLstDoiYwoTJD8Eq+eGlD4afD +SYo37ekWxJUmUzk22lnzXCAZbJeW6ZfLhU1ZNM4GS1UKrHHjerbmw9L3oHuNJc0ufMs sv70XAl1p3ND5JcgBQSCTCsoSrziSS+E2QxChxw17TtsXhnmU7Uj7P1rdWRDRwM1xQVP AV1t8eDdj9yXZwPXZJU5TVEdoNrR83hbMDnssmSQvM3HsVZ75zvbId2u6RD1iuV7wQPF w84Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oN/yJUhMwL79dfAOb7xMA38chypyQ6z1ZfDrW5oW+IQ=; fh=PW3pHPftUS1Q6LHv72ob2UtTpNyvwngZZp6xiXl9eCo=; b=vLmPptCqBXmjD2bsxn3pYUlUDaCnkqZ7LtnMb9YFjzwEHilJlRW/xSFausTWhruqj5 e/qZaPbJEMLyQXlE6GgKw66/EBUPQMYwNgPszvR2paoXGqlk0mpjMXbFQFBLFnjmknYU Y2+9u5omJVMwqfw08bRD+DlHamLhU5BQEc+iAVtMHPEvg23B4+9ngHzo95tLkY3R7OYs Abi3xSzSv55nvEG2FeM9DWBu3auNA/8uO2zCqLT+wNpVVA3L14N4hKDPJRrTrVPwfJ/Q VTOdH0BQRAUrqYiIVpOEmtHj/3A0x1/DLC/Bkv2zAlrba8YZM6Dlw7nVqkP+Lp1jimIS 0VPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protocubo.io header.s=google header.b=PFZlmOrf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=protocubo.io Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j24-20020a63cf18000000b00584ca25959csi6667411pgg.540.2023.12.03.08.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 08:37:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@protocubo.io header.s=google header.b=PFZlmOrf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=protocubo.io Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 72A288075DDA; Sun, 3 Dec 2023 08:37:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232094AbjLCQhY (ORCPT + 99 others); Sun, 3 Dec 2023 11:37:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjLCQhW (ORCPT ); Sun, 3 Dec 2023 11:37:22 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60F9EC0 for ; Sun, 3 Dec 2023 08:37:29 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cfc2bcffc7so12898395ad.1 for ; Sun, 03 Dec 2023 08:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protocubo.io; s=google; t=1701621449; x=1702226249; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oN/yJUhMwL79dfAOb7xMA38chypyQ6z1ZfDrW5oW+IQ=; b=PFZlmOrfgT+TLnLb7o5o36bU+jR6twG5EQPyq78afl/vpKDbEImtVHF4sqAD+AxbKD RMopbk7kCppv7RZZZkLIQNhr1L+gM8ktfIITvdI5fAcfYcjWVp3/O+U78/9nitVruHMK lqizRVhTS9pfe3YP0x0AZktCdmNLGtVkkm/xBb6kPXsC5lbQLXQMMwYC1PcvpSq0xNU3 YLgrPX3aOGymBc4hcp2V8YksnBnQt+juV8wG8kpy+g2GvEIlYQscn1S9lVxxWkaVy74y A/5Au4M5vYD2ABVrFVOuMMcLDctL4RUIdgWPON4YLMVf+Hd/4+meaItnuWFpGNb2CrYG ybCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701621449; x=1702226249; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oN/yJUhMwL79dfAOb7xMA38chypyQ6z1ZfDrW5oW+IQ=; b=Oj94esaj9HyJ909srLB8OMBM1dZZyfBQfGx4bMmNtLCJTPS4kuioJv7M1T5nA+TPGl 5kTIG57uJdSZ/dPyNhAxzeWoyyK0/asULGGYDDpBiSiz9LngeeuKvVMhY0FSyCPUEZTi QF0LUDczIbDI1ZKFjdwnsMhyCMTtwG8p+HKg4HBkdLLb5s7Ommy2y84j3Kbbv/SAbc6F y0+YUBwpbaSZtMnKVaW7XkCnS0cfES5htNhWvGvydtFEsdv6P41TzNW8DYctVtLFzheh A/t2QJYz+jUMpLYJvuyxcoZcDhny3P4gWPIr+S5PNPGZFJMV0piZF9KkPqqumTsKkODp ADhQ== X-Gm-Message-State: AOJu0Yw1AcmrJO+gX0LrHEziXqWJgzxnAKJndduJJwQfzZJD8k34xKaM 48x/RG8VUdTl6lnGyrW7k8jrFPLJHO9/a70T1+wfLw== X-Received: by 2002:a17:903:110e:b0:1cf:51f9:197b with SMTP id n14-20020a170903110e00b001cf51f9197bmr1361054plh.23.1701621448844; Sun, 03 Dec 2023 08:37:28 -0800 (PST) Received: from calvin.localdomain ([2804:14d:5c5e:6991::1000]) by smtp.gmail.com with ESMTPSA id q32-20020a17090a17a300b002860a7acca1sm6998750pja.10.2023.12.03.08.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 08:37:28 -0800 (PST) Date: Sun, 3 Dec 2023 13:37:24 -0300 From: Jonas Malaco To: Christophe JAILLET Cc: Jean Delvare , Guenter Roeck , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Aleksa Savic , linux-hwmon@vger.kernel.org Subject: Re: [PATCH] hwmon: nzxt: Fix some error handling path in kraken2_probe() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Sun, 03 Dec 2023 08:37:40 -0800 (PST) On Sun, Dec 03, 2023 at 04:24:05PM +0100, Christophe JAILLET wrote: > There is no point in calling hid_hw_stop() if hid_hw_start() has failed. > There is no point in calling hid_hw_close() if hid_hw_open() has failed. > > Update the error handling path accordingly. > > Fixes: 82e3430dfa8c ("hwmon: add driver for NZXT Kraken X42/X52/X62/X72") > Reported-by: Aleksa Savic > Closes: https://lore.kernel.org/all/121470f0-6c1f-418a-844c-7ec2e8a54b8e@gmail.com/ > Signed-off-by: Christophe JAILLET > --- > Closes added to please checkpatch, not sure if relevant here. > --- > drivers/hwmon/nzxt-kraken2.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwmon/nzxt-kraken2.c b/drivers/hwmon/nzxt-kraken2.c > index 428c77b5fce5..7caf387eb144 100644 > --- a/drivers/hwmon/nzxt-kraken2.c > +++ b/drivers/hwmon/nzxt-kraken2.c > @@ -161,13 +161,13 @@ static int kraken2_probe(struct hid_device *hdev, > ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); > if (ret) { > hid_err(hdev, "hid hw start failed with %d\n", ret); > - goto fail_and_stop; > + return ret; > } > > ret = hid_hw_open(hdev); > if (ret) { > hid_err(hdev, "hid hw open failed with %d\n", ret); > - goto fail_and_close; > + goto fail_and_stop; > } > > priv->hwmon_dev = hwmon_device_register_with_info(&hdev->dev, "kraken2", > -- > 2.34.1 > That was a silly mistake from me. Thanks for finding and fixing it. Reviewed-by: Jonas Malaco