From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687AbbILEg2 (ORCPT ); Sat, 12 Sep 2015 00:36:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57845 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754542AbbILEf3 (ORCPT ); Sat, 12 Sep 2015 00:35:29 -0400 Date: Fri, 11 Sep 2015 19:54:04 -0700 From: Greg Kroah-Hartman To: Sudip Mukherjee Cc: Lidza Louina , Mark Hounschell , Daeseok Youn , devel@driverdev.osuosl.org, driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] staging: dgap: fix possible NULL dereference Message-ID: <20150912025404.GC25966@kroah.com> References: <1441886099-24399-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441886099-24399-1-git-send-email-sudipm.mukherjee@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 10, 2015 at 05:24:58PM +0530, Sudip Mukherjee wrote: > The return pointer from dgap_getword() is used in strcmp() where it is > dereferenced. But dgap_getword() can return NULL. > Lets put a check there and return 0 as error. > > Signed-off-by: Sudip Mukherjee > --- > drivers/staging/dgap/dgap.c | 2 ++ > 1 file changed, 2 insertions(+) While this change is all nice and fine, this driver is totally abusing the firmware kernel interface to read in a "configuration file" and then parse it within the driver. That's not ok at all, no tty driver should ever need this. Please work to just rip all of that crap out. thanks, greg k-h