]> git.baikalelectronics.ru Git - kernel.git/commit
[MTD] Deal correctly with NOR chips which are smaller than the map window
authorDavid Woodhouse <dwmw2@infradead.org>
Sun, 14 May 2006 00:40:50 +0000 (01:40 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Sun, 14 May 2006 00:40:50 +0000 (01:40 +0100)
commit95b65cbf007425f2f898dec74e807c418fb8963c
treec06f26d34bff12e4324e901a6406835894010da3
parent277f672df69a506672c29d820dd0f2f85265eb3e
[MTD] Deal correctly with NOR chips which are smaller than the map window

We used to calculate the number of chips to be zero, allocate an array
of that size, then nasty things would happen when we attempt to access
the first object in that zero-sized array.

Now, if the number of _full_ chips that would fit into the map is zero,
we allocate an array of one anyway, and then artificially reduce the
total size of the resulting MTD device to fit in the map.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/chips/gen_probe.c