Received: by 10.223.185.116 with SMTP id b49csp763477wrg; Wed, 21 Feb 2018 06:34:43 -0800 (PST) X-Google-Smtp-Source: AH8x225bQ1YFKRvA9lmitScj5VGJDiFwqcTn1MfDDUjlHT5yRpP9HdJ7Qy3b3WW96KKokT/6VHvz X-Received: by 2002:a17:902:d882:: with SMTP id b2-v6mr3288564plz.292.1519223682948; Wed, 21 Feb 2018 06:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519223682; cv=none; d=google.com; s=arc-20160816; b=TNnbC8fmv44ql8m+JYe45M9+rsdeF6IMUaTO6b5jAzT+EXEMT4kekTFfzMAS5A5x4Y E2aNhoiIDr0KUSGoADEPc17xROCO0JvbWyq9JeH/dhSM4nmIZmK49IAjrJRV/B+c9bJ2 mV3Jyqt6q/ZaAd7nFK0C7tbqVb3iQfQQTerVagJKl6F2Hvvhxb4f+dIhzK5GQpgiFUsD mWxAioFDy+V8G5E4IeIYv7Rs+N3fSenxF+fcumOlMGVU/HlKAAUD0b6ynip+bgYCmmfD 7N6FUAg6As/Tf+BMDi//wgNmNZZplSINY7+xJCUj91CDclnACk/EsoMG50JZxIf4AJDX ytmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ZT946jLa3GMtj7GFed0+V5Z6mUnaWD4zieRIC6Nf7Uw=; b=c43yf2CvMVx8BN2fLaaIyQvpGMAfbXWvVnKn3X4CjnKpgmTmVcxdhkAwElMkA+nKm1 iBaAjN3xceZG+0qTN1ezBsehNtSfCxAKRO+VSjTPcvyPsLTM4wCOanc+vgnIi+FNlnbn IdyRo/L0r9W+0hw+jXeaOkBtgAczpYhWB+ZCzdApR/qAeNVJmyVQvfPZCLHNcUN608ea qiIxcDfSbdG9N+PMKooQiZNgMdi2n4XzwbEDCEEJNzcIq1YzbRAbpAsu/ShIJWc4wyOg GslYUsbx91A612nTzxKMwg8+wCu6xHIUglmaOAk6fDDOOeZTgTwY0QEEQVGiLoijBzwB 3xcA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si3104869pgq.491.2018.02.21.06.34.27; Wed, 21 Feb 2018 06:34:42 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934374AbeBUMzv (ORCPT + 99 others); Wed, 21 Feb 2018 07:55:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34558 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934341AbeBUMzt (ORCPT ); Wed, 21 Feb 2018 07:55:49 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6017C1192; Wed, 21 Feb 2018 12:55:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chanwoo Choi , Bjorn Andersson , MyungJoo Ham Subject: [PATCH 4.9 40/77] PM / devfreq: Propagate error from devfreq_add_device() Date: Wed, 21 Feb 2018 13:48:49 +0100 Message-Id: <20180221124433.865789803@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124432.172390020@linuxfoundation.org> References: <20180221124432.172390020@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bjorn Andersson commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream. Propagate the error of devfreq_add_device() in devm_devfreq_add_device() rather than statically returning ENOMEM. This makes it slightly faster to pinpoint the cause of a returned error. Fixes: 8cd84092d35e ("PM / devfreq: Add resource-managed function for devfreq device") Cc: stable@vger.kernel.org Acked-by: Chanwoo Choi Signed-off-by: Bjorn Andersson Signed-off-by: MyungJoo Ham Signed-off-by: Greg Kroah-Hartman --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -684,7 +684,7 @@ struct devfreq *devm_devfreq_add_device( devfreq = devfreq_add_device(dev, profile, governor_name, data); if (IS_ERR(devfreq)) { devres_free(ptr); - return ERR_PTR(-ENOMEM); + return devfreq; } *ptr = devfreq;