projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b2ff19
)
NVMe: Fix possible arithmetic overflow for max segments
author
Keith Busch
<
[email protected]
>
Wed, 18 Nov 2015 23:33:08 +0000
(16:33 -0700)
committer
Jens Axboe
<
[email protected]
>
Thu, 19 Nov 2015 20:02:24 +0000
(13:02 -0700)
Reported-by: Paul Grabinar <
[email protected]
>
Signed-off-by: Keith Busch <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
drivers/nvme/host/pci.c
patch
|
blob
|
history
diff --git
a/drivers/nvme/host/pci.c
b/drivers/nvme/host/pci.c
index 8187df20469535023ae9966aecfb1542260b4270..394fd1631cd0147c0ddd18da7814830f44a7fdd9 100644
(file)
--- a/
drivers/nvme/host/pci.c
+++ b/
drivers/nvme/host/pci.c
@@
-2268,7
+2268,7
@@
static void nvme_alloc_ns(struct nvme_dev *dev, unsigned nsid)
if (dev->max_hw_sectors) {
blk_queue_max_hw_sectors(ns->queue, dev->max_hw_sectors);
blk_queue_max_segments(ns->queue,
- (
(dev->max_hw_sectors << 9) / dev->page_size
) + 1);
+ (
dev->max_hw_sectors / (dev->page_size >> 9)
) + 1);
}
if (dev->stripe_size)
blk_queue_chunk_sectors(ns->queue, dev->stripe_size >> 9);