RE: [PATCH] iwlwifi: mvm: make debugfs write() operations write upto count bytes
From: Berg, Johannes
Date: Mon Aug 12 2013 - 04:19:35 EST
> Some debugfs write() operations of the MVM Firmware will ignore the count
> argument, and will copy more bytes than what was specified.
> Fix this by getting the right count of bytes.
>
> This will also honor restrictions put on the number of bytes to write.
That makes some sense.
> To be consitant this patch also switches the initializer from 'char buf[x] = {}' to
> the explicit memset() as it is done in other places of the same file.
I'd rather this (a) be done in a separate patch, and (b) the other way around, switch everything to C99.
> Cc: stable@xxxxxxxxxxxxxxx
That doesn't really make sense for the debugfs interface.
> + memset(buf, 0, sizeof(buf));
> + if (count > sizeof(buf) - 1)
> + count = sizeof(buf) - 1;
Why -1? And why not use min()/min_t()?
johannes
--
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/