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

Marc Dietich marvin24 at gmx.de
Thu Aug 25 08:29:03 UTC 2011


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



More information about the devel mailing list