[S390] missing check in dasd_eer_open.
authorStefan Weinhuber <wein@de.ibm.com>
Thu, 29 Jun 2006 12:57:46 +0000 (14:57 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 29 Jun 2006 12:57:46 +0000 (14:57 +0200)
Check the return value of kzalloc in dasd_eer_open.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd_eer.c

index 2d8af709947fb09fefdb32c2bb8b195845f11d69..9d574ede1b1d1ab10103657419961feb82bbe6e5 100644 (file)
@@ -521,6 +521,8 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
        unsigned long flags;
 
        eerb = kzalloc(sizeof(struct eerbuffer), GFP_KERNEL);
+       if (!eerb)
+               return -ENOMEM;
        eerb->buffer_page_count = eer_pages;
        if (eerb->buffer_page_count < 1 ||
            eerb->buffer_page_count > INT_MAX / PAGE_SIZE) {