diff options
author | Madalin Bucur <madalin.bucur@nxp.com> | 2017-08-27 16:13:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-28 16:41:01 -0700 |
commit | 52600dcc9e3ac4c023edd48984f3005ab8191e71 (patch) | |
tree | c90b97e3a4c4feabebaeae2942395930803f89f7 /drivers/net/ethernet/freescale | |
parent | 0659191630bd386d4ca76fdaa9b556cbdda48278 (diff) | |
download | linux-52600dcc9e3ac4c023edd48984f3005ab8191e71.tar.bz2 |
dpaa_eth: check allocation result
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |