Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1396309rwd; Tue, 13 Jun 2023 08:35:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Hh1cw0r7AsObfl4cXTjjLUwSqLgQXqn+J9X28DhusiCNFJC3cji1WU7tA98/+ibsrD0AS X-Received: by 2002:a17:902:b703:b0:1b3:e802:5de6 with SMTP id d3-20020a170902b70300b001b3e8025de6mr2263867pls.29.1686670548514; Tue, 13 Jun 2023 08:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686670548; cv=none; d=google.com; s=arc-20160816; b=re+/aITrcPZUFaKjtYXuK0DYaH8MTlWnrE8JyAdTzWSpVyX9VMWGDjGhYH1J5ncbO5 7gfyhDt/vq1NGhn7/difLCG1Q5edhWZYofDPfiGZ1bM5Wn8XkMHl+jKt7NyiueiQMtjj 49wfrY5fGbDA8VSwnbD58gbDuCYK48jAK/iTesJWKCeXnP/prDHjXK1bVk7agbY3R2Xe y4B87apwqzTQ7v/DC3iRpE/HQSGV7EKWKvW3TXZh8XCV0zafmkIgj+YCabBNxbXGlVxz SpzyAmkIaiHBYPWmlxkYTPcB3qIEwZc/XXXgs4Oq1rZQTgrSkRohAjiTZLys22o1Hjrr ANYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BIMM2mus8pB7ZIXkRsqs6zemA7OtFDbe06nKoqCXGws=; b=P7tGjJRzb0qfN4If4pCvi2mYOK++E6hvvpdpg4fTjKn2UQnhk4OYYVteWHfVbSXawh xXoBcG0r5Otinq4sEv0dKxD05HCxhYL/wvjLpcU790MxvJc35L8SDXCX6ghcvuj3N7RX MWr1A28sqrEv1pXYEWMwZaSazDfZG0iP5Wvm6WBunjQGVLP8e1iPMWgHN9pN/t37MSNt 5Gwb3JPtjgWVF1vmG8nelbEB4szuvs5LG5rtzsWk3MKvPI5NmHJXvS3VLnGeyMRw8yog VhKL45GOn43HwKGe8UDtp2SEAKhLYQiqLVAYf9P8PkUV1UD8F8P7Pt4tI+JwdzwdSa1B FZLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OISHmMY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a170902e84b00b001aae0c3fa03si9479147plg.473.2023.06.13.08.35.36; Tue, 13 Jun 2023 08:35:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OISHmMY9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241177AbjFMPMt (ORCPT + 99 others); Tue, 13 Jun 2023 11:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240877AbjFMPMr (ORCPT ); Tue, 13 Jun 2023 11:12:47 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC57D1991; Tue, 13 Jun 2023 08:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686669166; x=1718205166; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=oxh0515ME/4fPMSsCbIUJTNENfWdQwc2a7pCGR+KUNE=; b=OISHmMY9DXt5qo74Xu94Gqc/P3Mn8fMNoJfgTIB+rEX5k+jVi1Vo+yer 7Xwr8qrV1EVmEtuQ3XO0Jv2P7V0foDnfQMIaDEHfYfQlSkWjCf1zQF4Pz 8A5AoJEHLb17NVXsZZhnid4Ax/VtXdrzQzx45usaaxdh7B15pScY2UupR fKTJiLZ5808ATVKMs+DOuX1RLXsuPup0QbVwbZld6h05eDv27EcpX2Heq qpeJo8vfNbBKyGgal/S/McoRdnJLhcjQgouQTDQjjZKQ5qjgCh3gQDe6F wmqDTfK+6nZttRY+BXmaD4PmW3MVoRMOdzyYelgPYnkCM+NMvgvbmOh2w w==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="361730934" X-IronPort-AV: E=Sophos;i="6.00,240,1681196400"; d="scan'208";a="361730934" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 08:12:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="824427345" X-IronPort-AV: E=Sophos;i="6.00,240,1681196400"; d="scan'208";a="824427345" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 13 Jun 2023 08:12:42 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1q95hJ-003U4D-0H; Tue, 13 Jun 2023 18:12:41 +0300 Date: Tue, 13 Jun 2023 18:12:40 +0300 From: Andy Shevchenko To: Michal Wilczynski Cc: linux-acpi@vger.kernel.org, rafael@kernel.org, ilpo.jarvinen@linux.intel.com, pali@kernel.org, hdegoede@redhat.com, markgross@kernel.org, fengguang.wu@intel.com, dvhart@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] platform/x86/dell/dell-rbtn: Fix resources leaking on error path Message-ID: References: <20230613084310.2775896-1-michal.wilczynski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230613084310.2775896-1-michal.wilczynski@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 13, 2023 at 11:43:10AM +0300, Michal Wilczynski wrote: > Currently rbtn_add() in case of failure is leaking resources. Fix this > by adding a proper rollback. Move devm_kzalloc() before rbtn_acquire(), > so it doesn't require rollback in case of failure. While at it, remove > unnecessary assignment of NULL to device->driver_data and unnecessary > whitespace, plus add a break for the default case in a switch. > Suggested-by: Ilpo J?rvinen Isn't also suggested by Pali? > Fixes: 817a5cdb40c8 ("dell-rbtn: Dell Airplane Mode Switch driver") > Signed-off-by: Michal Wilczynski > Reviewed-by: Andy Shevchenko > Acked-by: Rafael J. Wysocki ... Hans, can it (an additional tag) be folded into applied change? -- With Best Regards, Andy Shevchenko