[COMMON] usb: gadget: print limited dump to avoid hard lockup
authorKisang Lee <kisang80.lee@samsung.com>
Tue, 11 Sep 2018 07:41:40 +0000 (16:41 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:04 +0000 (20:23 +0300)
Change-Id: I066380d1bec3b5a3286625f2c4394faae4307849
Signed-off-by: Kisang Lee <kisang80.lee@samsung.com>
drivers/usb/gadget/function/rndis.c

index b6c707246dadd7f727e1855b32d927df28db40c9..ef32e88478666bfa99c20796679a0308917f353c 100644 (file)
@@ -858,6 +858,9 @@ int rndis_msg_parser(struct rndis_params *params, u8 *buf)
                 */
                pr_warn("%s: unknown RNDIS message 0x%08X len %d\n",
                        __func__, MsgType, MsgLength);
+               /* Garbled message can be huge, so limit what we display */
+               if (MsgLength > 16)
+                       MsgLength = 16;
                print_hex_dump_bytes(__func__, DUMP_PREFIX_OFFSET,
                                     buf, MsgLength);
                break;