Search Linux Wireless

Re: [PATCH] ath6kl: print firmware capabilities

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

 



Joe Perches <joe@xxxxxxxxxxx> writes:

> On Tue, 2013-03-05 at 18:38 +0200, Kalle Valo wrote:
>> Printin the  firmware capabilities during the first firmware boot makes it easier to find out what
>> features firmware supports.
> []
>> diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
> []
>> +static void ath6kl_init_fw_capas(struct ath6kl *ar, char *buf, size_t buf_len)
>> +{
> []
>> +		if (buf_len - len < 4) {
>> +			ath6kl_warn("firmware capability buffer too small!\n");
>> +			strncpy(buf, "<error>", buf_len);
>
> 4 is an odd size to use.

I have to admit that I was lazy here. I think "< 2" (or "== 1") would be
the correct value to use but I didn't check that and just used 4 to be
on the safe side :)

> It seems weird to overwrite the known bits.

I did that just to make sure that the truncation won't be missed.

> why not just add ...?

You mean to the end of buffer? Like "first,second,th..."? Looks good,
I'll do that.

-- 
Kalle Valo
--
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