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:
10433d0
)
block: reject attempts to allocate more than DISK_MAX_PARTS partitions
author
Christoph Hellwig
<hch@lst.de>
Wed, 23 Aug 2017 17:10:29 +0000
(19:10 +0200)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 23 Aug 2017 18:49:50 +0000
(12:49 -0600)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
patch
|
blob
|
history
diff --git
a/block/genhd.c
b/block/genhd.c
index 2367087cdb7c47726338345c8539069da3bc0e82..3380a1e73ea0a69cd39d104bd714b8689c575b93 100644
(file)
--- a/
block/genhd.c
+++ b/
block/genhd.c
@@
-1357,6
+1357,13
@@
struct gendisk *alloc_disk_node(int minors, int node_id)
struct gendisk *disk;
struct disk_part_tbl *ptbl;
+ if (minors > DISK_MAX_PARTS) {
+ printk(KERN_ERR
+ "block: can't allocated more than %d partitions\n",
+ DISK_MAX_PARTS);
+ minors = DISK_MAX_PARTS;
+ }
+
disk = kzalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id);
if (disk) {
if (!init_part_stats(&disk->part0)) {