From: Wei Yongjun <[email protected]>

Fix to return -ENOMEM in the alloc_page() error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <[email protected]>
---
 drivers/platform/x86/dell-laptop.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c 
b/drivers/platform/x86/dell-laptop.c
index 1134119..bb77e18 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -551,9 +551,10 @@ static int __init dell_init(void)
         * is passed to SMI handler.
         */
        bufferpage = alloc_page(GFP_KERNEL | GFP_DMA32);
-
-       if (!bufferpage)
+       if (!bufferpage) {
+               ret = -ENOMEM;
                goto fail_buffer;
+       }
        buffer = page_address(bufferpage);
 
        if (quirks && quirks->touchpad_led)

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to