From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCA22C48BE8 for ; Mon, 24 Jun 2019 07:37:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A474E2089F for ; Mon, 24 Jun 2019 07:37:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="BwzWJ/ET" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbfFXHh5 (ORCPT ); Mon, 24 Jun 2019 03:37:57 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:19731 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFXHhu (ORCPT ); Mon, 24 Jun 2019 03:37:50 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20190624073746epoutp0101e0b4efc762c0bf10c412d7a071c879~rElhYj5RQ0428604286epoutp01Z for ; Mon, 24 Jun 2019 07:37:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20190624073746epoutp0101e0b4efc762c0bf10c412d7a071c879~rElhYj5RQ0428604286epoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1561361866; bh=hZZu54p+MpOQw7pjLcHefLtdEZhcZzg7toiu4G8PxMI=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=BwzWJ/ETwBSj+fMM+9PwWWzwyigrr07z05Xx7YcWASCvpR9y+r7j9CLqBXlS+b8Y4 OTLCVnlHFVCaeGVmh0COQwxveMlr+Qs3fWouEZwpgIMHrBNUwy7TDhdWtB9O7VdJnC Sbi6TS/H+oXLWvujm/5A8F8dFaS5Ju149Al1pWkc= Received: from epsmges1p5.samsung.com (unknown [182.195.40.158]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20190624073744epcas1p24d39a53ba61b5949c2af6bf108108416~rElfLZr6t0162501625epcas1p2j; Mon, 24 Jun 2019 07:37:44 +0000 (GMT) X-AuditID: b6c32a39-89fff7000000100c-72-5d107dc69115 Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 78.3D.04108.6CD701D5; Mon, 24 Jun 2019 16:37:42 +0900 (KST) Mime-Version: 1.0 Subject: RE: [PATCH v2] PM / devfreq: Fix kernel oops on governor module load Reply-To: myungjoo.ham@samsung.com From: MyungJoo Ham To: Kyungmin Park , Chanwoo Choi CC: "kernel@collabora.com" , "linux-pm@vger.kernel.org" , Enric Balletbo i Serra , Ezequiel Garcia X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20190621213949.27018-1-ezequiel@collabora.com> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20190624073742epcms1p29979ff8c388b70e6e03b0e6f7ccf51db@epcms1p2> Date: Mon, 24 Jun 2019 16:37:42 +0900 X-CMS-MailID: 20190624073742epcms1p29979ff8c388b70e6e03b0e6f7ccf51db Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUhTYRTGe737uFo3X6fVyc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RootMailID: 20190621214003epcas5p4682d7d258b3ec2ae92521111fe8864ab References: <20190621213949.27018-1-ezequiel@collabora.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org > A bit unexpectedly (but still documented), request_module may > return a positive value, in case of a modprobe error. > This is currently causing issues in the devfreq framework. > > When a request_module exits with a positive value, we currently > return that via ERR_PTR. However, because the value is positive, > it's not a ERR_VALUE proper, and is therefore treated as a > valid struct devfreq_governor pointer, leading to a kernel oops. > > Fix this by returning -EINVAL if request_module returns a positive > value. > > Fixes: b53b0128052ff ("PM / devfreq: Fix static checker warning in try_then_request_governor") > Signed-off-by: Ezequiel Garcia > --- > Changes from v1: > * Rework the fix as suggested by Enric and Chanwoo, > handling the return vaue. > --- > drivers/devfreq/devfreq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: MyungJoo Ham