All of lore.kernel.org
 help / color / mirror / Atom feed
* [BlueZ PATCH] shared: Fix the incorrect type with bit shift
@ 2022-02-17  6:31 Tedd Ho-Jeong An
  2022-02-17  8:00 ` [BlueZ] " bluez.test.bot
  2022-02-17  9:55 ` [BlueZ PATCH] " Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Tedd Ho-Jeong An @ 2022-02-17  6:31 UTC (permalink / raw)
  To: linux-bluetooth

From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch fixes the following runtime error:

$ sudo ./monitor/btmon -w test.btsnoop
  Bluetooth monitor ver 5.63
  src/shared/btsnoop.c:339:18: runtime error: left shift of 65535 by 16 places cannot be represented in type 'int'
---
 src/shared/btsnoop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/btsnoop.c b/src/shared/btsnoop.c
index a29bc928f..0a68282bc 100644
--- a/src/shared/btsnoop.c
+++ b/src/shared/btsnoop.c
@@ -336,7 +336,7 @@ bool btsnoop_write_hci(struct btsnoop *btsnoop, struct timeval *tv,
 		break;
 
 	case BTSNOOP_FORMAT_MONITOR:
-		flags = (index << 16) | opcode;
+		flags = ((uint32_t)index << 16) | opcode;
 		break;
 
 	default:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-17 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17  6:31 [BlueZ PATCH] shared: Fix the incorrect type with bit shift Tedd Ho-Jeong An
2022-02-17  8:00 ` [BlueZ] " bluez.test.bot
2022-02-17  9:55 ` [BlueZ PATCH] " Marcel Holtmann
2022-02-17 16:36   ` Tedd Ho-Jeong An

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.