netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] isdn: fix a wrapping bug in isdn_ppp_ioctl()
@ 2012-10-10  9:42 Dan Carpenter
  2012-10-10 10:19 ` Joe Perches
  2012-10-11  2:46 ` David Miller
  0 siblings, 2 replies; 15+ messages in thread
From: Dan Carpenter @ 2012-10-10  9:42 UTC (permalink / raw)
  To: Karsten Keil; +Cc: David S. Miller, Masanari Iida, netdev, kernel-janitors

"protos" is an array of unsigned longs and "i" is the number of bits in
an unsigned long so we need to use 1UL as well to prevent the shift
from wrapping around.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index a1e7601..69b5b58 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -595,7 +595,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 			j = ipc->num / (sizeof(long) * 8);
 			i = ipc->num % (sizeof(long) * 8);
 			if (j < 8)
-				protos[j] |= (0x1 << i);
+				protos[j] |= (1UL << i);
 			ipc = ipc->next;
 		}
 		if ((r = set_arg(argp, protos, 8 * sizeof(long))))

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

end of thread, other threads:[~2012-10-12  7:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10  9:42 [patch] isdn: fix a wrapping bug in isdn_ppp_ioctl() Dan Carpenter
2012-10-10 10:19 ` Joe Perches
2012-10-10 10:41   ` Joe Perches
2012-10-10 10:42   ` David Laight
2012-10-10 11:15     ` Joe Perches
2012-10-10 12:05   ` Andreas Schwab
2012-10-10 13:00     ` Joe Perches
2012-10-10 13:58       ` Andreas Schwab
2012-10-10 14:41         ` Joe Perches
2012-10-10 14:59           ` David Laight
2012-10-10 15:19             ` Joe Perches
2012-10-10 15:44               ` David Laight
2012-10-10 15:52                 ` Joe Perches
2012-10-12  7:49                   ` Karsten Keil
2012-10-11  2:46 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).