Re: pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..."

From: Bjorn Helgaas
Date: Fri Apr 18 2008 - 17:48:49 EST


On Wednesday 16 April 2008 07:02:20 pm Chris Wright wrote:
> -stable review patch. If anyone has any objections, please let us know.

I don't object to the point of the patch (changing KERN_ERR to
KERN_WARNING), but there is a more serious bug lurking here that
corrupts memory, and if we're doing a -stable patch, we should
fix it.

The test is:

if (i >= PNP_MAX_IRQ && !warned) {
printk(...);
warned = 1;
return;
}

But it should be:

if (i >= PNP_MAX_IRQ) {
if (!warned) {
printk(...);
warned = 1;
}
return;
}

> --- a/drivers/pnp/pnpacpi/rsparser.c
> +++ b/drivers/pnp/pnpacpi/rsparser.c
> @@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqr
> i < PNP_MAX_IRQ)
> i++;
> if (i >= PNP_MAX_IRQ && !warned) {
> - printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
> + printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ "
> "resources: %d \n", PNP_MAX_IRQ);
> warned = 1;
> return;
> @@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmar
> res->dma_resource[i].start = dma;
> res->dma_resource[i].end = dma;
> } else if (!warned) {
> - printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
> + printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA "
> "resources: %d \n", PNP_MAX_DMA);
> warned = 1;
> }
> @@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_iore
> res->port_resource[i].start = io;
> res->port_resource[i].end = io + len - 1;
> } else if (!warned) {
> - printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
> + printk(KERN_WARNING "pnpacpi: exceeded the max number of IO "
> "resources: %d \n", PNP_MAX_PORT);
> warned = 1;
> }
> @@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memr
> res->mem_resource[i].start = mem;
> res->mem_resource[i].end = mem + len - 1;
> } else if (!warned) {
> - printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
> + printk(KERN_WARNING "pnpacpi: exceeded the max number of mem "
> "resources: %d\n", PNP_MAX_MEM);
> warned = 1;
> }
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/