rocker: return -ENOMEM in case of some world alloc fails
authorJiri Pirko <jiri@mellanox.com>
Thu, 25 Feb 2016 14:31:56 +0000 (15:31 +0100)
committerJason Wang <jasowang@redhat.com>
Tue, 8 Mar 2016 07:34:18 +0000 (15:34 +0800)
Until now, 0 is returned in this error case. Fix it ro return -ENOMEM.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/rocker/rocker.c

index a1d921dc1cb7bda4588ff1c222de67b149679780..104c097852e0178399ed7ed86cbe013bcaa0e166 100644 (file)
@@ -1301,6 +1301,7 @@ static int pci_rocker_init(PCIDevice *dev)
 
     for (i = 0; i < ROCKER_WORLD_TYPE_MAX; i++) {
         if (!r->worlds[i]) {
+            err = -ENOMEM;
             goto err_world_alloc;
         }
     }