Search Linux Wireless

Re: [PATCH 2/2] ath6kl: add blocking debugfs file for retrieving firmware logs

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

 



On Mon, Feb 06, 2012 at 07:47:26PM +0200, Kalle Valo wrote:
> > Are you not making sure that the
> > length of the data is not more than the requested one which is
> > passed to copy_to_user() so that read() is always called with
> > *ppos=0?. The following code seems to do that
> 
> But the function is called multiple times with increasing values of
> *ppos as more data is returned to user space:
> 
> [  100.303747] ath6kl_fwlog_block_read(): *ppos 0
> [  100.305252] ath6kl_fwlog_block_read(): *ppos 30116
> [  101.768947] ath6kl_fwlog_block_read(): *ppos 31624
> [  117.027469] ath6kl_fwlog_block_read(): *ppos 33124
> [  117.090146] ath6kl_fwlog_block_read(): *ppos 34628
> [  117.172338] ath6kl_fwlog_block_read(): *ppos 36128
> 
> So I can't assume that *ppos = 0.

Right, unless we say we have no more data to pass
(when read() returns 0), *ppos would be keep on increasing
by the number of bytes copied to user space. Updating *ppos
just looks like a formality here though. But I'm also not
sure about doing it cleanly.

Vasanth
--
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 Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux