Re: [pm] fix oops after saving image

From: Patrick Mochel
Date: Thu Oct 02 2003 - 11:46:09 EST



> --- tmp/linux/kernel/power/swsusp.c 2003-10-02 00:04:35.000000000 +0200
> +++ linux/kernel/power/swsusp.c 2003-10-01 23:56:49.000000000 +0200
> @@ -345,7 +348,7 @@
> printk( "|\n" );
>
> MDELAY(1000);
> - free_page((unsigned long) buffer);
> + /* Trying to free_page((unsigned long) buffer) here is bad idea, not sure why */
> return 0;
> }

Patches like this really do a disservice to anyone trying to read the code
and figure out what is going on. I've spent a considerable amount of time
deciphering and santizing the swsusp code, which is why pmdisk exists.

The patch is simply a band-aid, and completely meaningless without the
context of the email. If I applied this, one would be able to ascertain
the reason for the patch, if they manipulated the BK tools correctly.
However, seeing that line solely in the context on the rest of the source
makes one cock their head, squint their eyes and pray that they never have
to look at that file again.

If you're seeing an Oops, please search more for the cause and submit a
real fix for it.

Or, simply change the semantics of the code enough to eliminate the
possibility of a problem. In the pmdisk code, I've statically declared the
header, so we don't need that alloc/free. Please see that file for an
example.


Pat

-
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/