Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752453AbdLGX5q (ORCPT ); Thu, 7 Dec 2017 18:57:46 -0500 Received: from gateway22.websitewelcome.com ([192.185.47.48]:13502 "EHLO gateway22.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751001AbdLGX5p (ORCPT ); Thu, 7 Dec 2017 18:57:45 -0500 Date: Thu, 07 Dec 2017 17:57:44 -0600 Message-ID: <20171207175744.Horde.9NnT_zmVm82lkttN8KTbaNG@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: MyungJoo Ham Cc: Kyungmin Park , Chanwoo Choi , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / devfreq: Fix potential NULL pointer dereference in governor_store References: <20171206202015.GA15636@embeddedor.com> <20171207024144epcms1p4d7e1a981c7c307190a85e8c35174d983@epcms1p4> In-Reply-To: <20171207024144epcms1p4d7e1a981c7c307190a85e8c35174d983@epcms1p4> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Source-L: Yes X-Exim-ID: 1eN62y-004MDE-GN X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:60154 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 676 Lines: 27 Quoting MyungJoo Ham : >> df->governor is being dereferenced before it is null checked, >> hence there is a potential null pointer dereference. >> >> Notice that df->governor is being null checked at line 1004: >> if (df->governor) {, which implies it might be null. >> >> Fix this by null checking df->governor before dereferencing it. >> >> Addresses-Coverity-ID: 1401988 ("Dereference before null check") >> Fixes: bcf23c79c4e4 ("PM / devfreq: Fix available_governor sysfs") >> Signed-off-by: Gustavo A. R. Silva > > Acked-by: MyungJoo Ham > Thank you, MyungJoo -- Gustavo A. R. Silva