From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762864AbbA3RGg (ORCPT ); Fri, 30 Jan 2015 12:06:36 -0500 Received: from mail-ig0-f182.google.com ([209.85.213.182]:43306 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756854AbbA3RGf (ORCPT ); Fri, 30 Jan 2015 12:06:35 -0500 MIME-Version: 1.0 In-Reply-To: <32395.1422623364@turing-police.cc.vt.edu> References: <1422557288-3617-1-git-send-email-rickard_strandqvist@spectrumdigital.se> <21497.1422569560@turing-police.cc.vt.edu> <20150130130001.GZ6456@mwanda> <32395.1422623364@turing-police.cc.vt.edu> Date: Fri, 30 Jan 2015 18:06:33 +0100 Message-ID: Subject: Re: [PATCH] staging: media: lirc: lirc_zilog: Fix for possible null pointer dereference From: Rickard Strandqvist To: Valdis.Kletnieks@vt.edu Cc: Dan Carpenter , "devel@driverdev.osuosl.org" , Gulsah Kose , Greg Kroah-Hartman , Jarod Wilson , Mauro Carvalho Chehab , Linux Kernel Mailing List , Tuomas Tynkkynen , Martin Kaiser , linux-media@vger.kernel.org, Aya Mahfouz Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2015-01-30 14:09 GMT+01:00 : > On Fri, 30 Jan 2015 16:00:02 +0300, Dan Carpenter said: > >> > > - if (ir == NULL) { >> > > - dev_err(ir->l.dev, "close: no private_data attached to the file > !\n"); >> > >> > Yes, the dev_err() call is an obvious thinko. >> > >> > However, I'm not sure whether removing it entirely is right either. If >> > there *should* be a struct IR * passed there, maybe some other printk() >> > should be issued, or even a WARN_ON(!ir), or something? >> >> We set filep->private_data to non-NULL in open() so I don't think it can >> be NULL here. > > Then probably the *right* fix is to remove the *entire* if statement, as > we can't end up doing the 'return -ENODEV'.... Hi Ok, but think or know. Who knows? Do the remove if patch? Kind regards Rickard Strandqvist