[PATCH] staging/ipack: Fix bug introduced by IPack device matching

Jens Taprogge jens.taprogge at taprogge.org
Fri Sep 7 08:27:42 UTC 2012


On Thu, Sep 06, 2012 at 03:09:06PM -0700, Greg KH wrote:
> On Thu, Sep 06, 2012 at 06:53:14PM +0200, Samuel Iglesias Gonsálvez wrote:
> > On 09/06/2012 06:17 PM, Jens Taprogge wrote:
> > > ~0 is not casted to u8.  Instead of using the IPACK_ANY_ID for the 
> > > format field we introduce a new IPACK_ANY_FORMAT specifically for
> > > that field and defined as 0xff.
> > > 
> > > Reported-by: Dan Carpenter <dan.carpenter at oracle.com> 
> > > Signed-off-by: Jens Taprogge <jens.taprogge at taprogge.org> --- 
> > > drivers/staging/ipack/ipack.c   |    3 ++- 
> > > include/linux/mod_devicetable.h |    1 + 2 files changed, 3
> > > insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/staging/ipack/ipack.c
> > > b/drivers/staging/ipack/ipack.c index b3736c0..659aadc 100644 ---
> > > a/drivers/staging/ipack/ipack.c +++
> > > b/drivers/staging/ipack/ipack.c @@ -31,7 +31,8 @@ static inline
> > > const struct ipack_device_id * ipack_match_one_device(const struct
> > > ipack_device_id *id, const struct ipack_device *device) { -	if
> > > ((id->format == IPACK_ANY_ID || id->format == device->id_format)
> > > && +	if ((id->format == IPACK_ANY_FORMAT || +				id->format ==
> > > device->id_format) && (id->vendor == IPACK_ANY_ID || id->vendor ==
> > > device->id_vendor) && (id->device == IPACK_ANY_ID || id->device ==
> > > device->id_device)) return id; diff --git
> > > a/include/linux/mod_devicetable.h
> > > b/include/linux/mod_devicetable.h index 999c4c2..70c6a35 100644 ---
> > > a/include/linux/mod_devicetable.h +++
> > > b/include/linux/mod_devicetable.h @@ -600,6 +600,7 @@ struct
> > > x86_cpu_id { #define X86_MODEL_ANY  0 #define X86_FEATURE_ANY 0	/*
> > > Same as FPU, you can't test for that */
> > > 
> > > +#define IPACK_ANY_FORMAT 0xff #define IPACK_ANY_ID (~0) struct
> > > ipack_device_id { __u8  format;			/* Format version or IPACK_ANY_ID
> > > */
> > > 
> > 
> > Acked-by: Samuel Iglesias Gons�lvez <siglesias at igalia.com>
> 
> Jens, can you resend this and cc: me so that I can properly apply it?
> 
> thanks,
> 
> greg k-h

Greg, I will send the patch as a reply to this email.

What are the build options to see these warnings?

Sam: Please ACK again.  In the earlier patch I missed the case in
file2alias.

Best Regards,
Jens



More information about the devel mailing list