From: Madalin Bucur Date: Sun, 27 Aug 2017 13:13:43 +0000 (+0300) Subject: dpaa_eth: check allocation result X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=52600dcc9e3ac4c023edd48984f3005ab8191e71;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git dpaa_eth: check allocation result Signed-off-by: Madalin Bucur Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 73ca8d761e18..42258060f142 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2561,6 +2561,9 @@ static struct dpaa_bp *dpaa_bp_alloc(struct device *dev) dpaa_bp->bpid = FSL_DPAA_BPID_INV; dpaa_bp->percpu_count = devm_alloc_percpu(dev, *dpaa_bp->percpu_count); + if (!dpaa_bp->percpu_count) + return ERR_PTR(-ENOMEM); + dpaa_bp->config_count = FSL_DPAA_ETH_MAX_BUF_COUNT; dpaa_bp->seed_cb = dpaa_bp_seed;