Commit ef21bdc5 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: refactor dump_chip_info()



Refactor the function dump_chip_info() to make the code cleaner and
reduce the driver object file size. Instead of using sprintf() to
print all the information to a buffer use a char pointer for the cut
version string and print the other strings directly by netdev_dbg().
For the unknown cut string we can use a smaller buffer and print to
that buffer with snprintf() to be safe.

These changes avoid the possible buffer overflow that the original
code had and reduces the driver object file size by 1029 bytes.

Suggested-by: default avatarJoe Perches <joe@perches.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220730150637.3550-3-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c026b483
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment