Re: [PATCH 1/8] staging: nvec: convert to use platform register andmfdcells

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

thanks for your comments and yes, this looks wrong. In Patch 5 of this series, 
the whole crap is therefore being removed.

Marc

> On Wed, Aug 24, 2011 at 08:23:07PM +0200, Marc Dietrich wrote:
> > @@ -139,7 +159,7 @@ static void nvec_dispatch(struct work_struct *work)
> > 
> >  		} else {
> >  		
> >  			parse_msg(nvec, msg);
> 
> This isn't a comment on this patch, but just something I noticed in
> passing.  parse_msg() dereferences msg so check on the next line is
> too late.
> 
> >  			if((!msg) || (!msg->data))
> 
>                            ^^^^^^
> Too late.
> 
> > -				dev_warn(nvec->dev, "attempt access zero pointer");
> > +				dev_warn(nvec->dev, "attempt access zero pointer\n");
> > 
> >  			else {
> >  			
> >  				kfree(msg->data);
> 
>                                       ^^^^^^^^^
> Another inconsistence dereference here (would oops if msg were NULL).
> 
> >  				kfree(msg);
> 
> regards,
> dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux