# Re: \[patch 1/2 -next\] hid-lg4ff: silence sparse complaint

- List: linux-input
- 1 message, 1 author
- Page: https://ratatoskr.run/linux-input/2011/08/8917527/t

## Re: \[patch 1/2 -next\] hid-lg4ff: silence sparse complaint

- From: Dan Carpenter \<hidden\>
- Date: 2011-08-18 16:23:58 
- Message: https://ratatoskr.run/linux-input/2011/08/8917527.md

```text
On Thu, Aug 18, 2011 at 07:50:45PM +0530, Zic Rim wrote:
> > device_attribute *attr, char *buf)
> >  {
> > -       struct lg4ff_device_entry *entry = 0;
> > +       struct lg4ff_device_entry *uninitialized_var(entry);
> >
> 
> I think this is better      struct lg4ff_device_entry *entry = NULL ;
> 

We only have the initialization to silence a gcc warning.  My way is
more explicit.  If we set entry = NULL then other static analysis
tools complain about a potential NULL dereference.

regards,
dan carpenter

```
