Re: [PATCH] staging: rtl8192u: Remove an unnecessary NULL check

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

 



On Tue, May 21, 2019 at 03:57:46PM -0700, Nick Desaulniers wrote:
> > > -       if (param->u.wpa_ie.len > MAX_WPA_IE_LEN ||
> > > -           (param->u.wpa_ie.len && !param->u.wpa_ie.data))
> >
> > Right so, the types in this expression:
> >
> > param: struct ieee_param*
> > param->u: *anonymous union*
> > param->u.wpa_ie: *anonymous struct*
> > param->u.wpa_ie.len: u32
> > param->u.wpa_ie.data: u8 [0]
> > as defined in drivers/staging/rtl8192u/ieee80211/ieee80211.h#L295
> > https://github.com/ClangBuiltLinux/linux/blob/9c7db5004280767566e91a33445bf93aa479ef02/drivers/staging/rtl8192u/ieee80211/ieee80211.h#L295-L322
> >
> > so this is a tricky case, because in general array members can never
> > themselves be NULL,


Unless they array was the first struct member, obviously.


> >  and usually I trust -Wpointer-bool-conversion, but
> > this is a special case because of the flexible array member:

Nah.  It's the same thing.  That patch is fine.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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