Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756398Ab2HFONI (ORCPT ); Mon, 6 Aug 2012 10:13:08 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:34200 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756074Ab2HFONH (ORCPT ); Mon, 6 Aug 2012 10:13:07 -0400 Date: Mon, 6 Aug 2012 17:12:48 +0300 From: Dan Carpenter To: Devendra Naga Cc: Greg Kroah-Hartman , Javier =?iso-8859-1?Q?Mu=F1oz?= , Paul Gortmaker , Devendra Naga , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: sm7xxfb: copy name of the device before calling smtc_alloc_fb_info Message-ID: <20120806141248.GN4352@mwanda> References: <1344100872-19640-1-git-send-email-develkernel412222@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1344100872-19640-1-git-send-email-develkernel412222@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1651 Lines: 45 On Sat, Aug 04, 2012 at 11:06:12PM +0545, Devendra Naga wrote: > as we do a strcpy(smdrv_ptr->fb_struct->fix->id, name), and the name here in > sm7xxx_probe is not having any assignment, and which leads to copying of the garbage value > into the id field of the fix struct of fb interface struct. fix it by copying the name before > calling alloc_fbinfo > > Signed-off-by: Devendra Naga > --- > Only compile tested > This patch is not tested using the hardware... if any one is having this hardware, i request them to > please test this > drivers/staging/sm7xxfb/sm7xxfb.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c > index 1c1780c..d3957ef 100644 > --- a/drivers/staging/sm7xxfb/sm7xxfb.c > +++ b/drivers/staging/sm7xxfb/sm7xxfb.c > @@ -798,16 +798,17 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev, > if (err) > return err; > > + sprintf(name, "sm%Xfb", ent->device); > + > sfb = smtc_alloc_fb_info(pdev, name); > > + sfb->chip_id = ent->device; > + > if (!sfb) { Thanks for fixing this, and well done for spotting the bug. There is a dereference before the check here, but I see you resent this in another thread. Next time could you respond to the original with a message which says to not apply it. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/