mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 22:02:28 +00:00
[PATCH] drivers/pnp/pnpbios/rsparser.c: fix an array overflow
This patch fixes an array overflow found by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
408b664a7d
commit
6e3e98d1dc
@ -72,7 +72,9 @@ static void
|
|||||||
pnpbios_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
|
pnpbios_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_DMA) i++;
|
while (i < PNP_MAX_DMA &&
|
||||||
|
!(res->dma_resource[i].flags & IORESOURCE_UNSET))
|
||||||
|
i++;
|
||||||
if (i < PNP_MAX_DMA) {
|
if (i < PNP_MAX_DMA) {
|
||||||
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
|
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
|
||||||
if (dma == -1) {
|
if (dma == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user