Search Linux Wireless

Re: [PATCH 1/2] iwlwifi: fix freeing uninitialized pointer

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

 



On Tue, Apr 16, 2013 at 08:40:30PM +0200, Jonas Gorski wrote:
> > +       ret = iwl_dump_nic_event_log(priv, true, &buf, true);
> > +       if (ret < 0)
> > +               goto err;
> > +       ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
> > +err:
> 
> Not every error check needs a goto, you can avoid it by inverting the
> condition: ;-)
> 
> 	ret = iwl_dump_nic_event_log(priv, true, &buf, true);
> 	if (ret >= 0) /* or maybe even > 0, because AFAICT 0 => nothing to read */
> 		ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
> 	kfree(buf);

Make sense. Since this is only code cleanup issue and 
simple_read_from_buffer(..., 0) is ok, I'll post incremental
patch which fix this.

Thanks
Stanislaw
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux