From: Philipp Hortmann Date: Mon, 18 Sep 2023 16:43:10 +0000 (+0200) Subject: staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e2572686a5a8fa35f8d1a449311f1b98165e4015;p=linux.git staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name iwe.u.name and proto_name have both 16 bytes of space. But when writing to iwe.u.name the first 10 bytes are used by the fixed string "IEEE802.11". Evaluating the code shows that only the following strings can occur in proto_name: "N-24G", "g", "b", "bg". Therefore it is sufficient to shorten proto_name to 6 bytes. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309171733.Gl96cmYd-lkp@intel.com/ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2caafb8628880570725385e87150c47689474fc4.1695054044.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index e9469bfef3dde..a37250de7ba37 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -29,7 +29,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee, struct iw_request_info *info) { char custom[MAX_CUSTOM_LEN]; - char proto_name[IFNAMSIZ]; + char proto_name[6]; char *pname = proto_name; char *p; struct iw_event iwe;