mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc

devm_kzalloc() returns NULL on failure.

Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
This commit is contained in:
Axel Lin 2016-03-21 20:12:20 +08:00 • committed by Jassi Brar
commit a61b37ead5

View file

@ -189,8 +189,8 @@ static int slimpro_mbox_probe(struct platform_device *pdev)
int i;
ctx = devm_kzalloc(&pdev->dev, sizeof(struct slimpro_mbox), GFP_KERNEL);
if (IS_ERR(ctx))
return PTR_ERR(ctx);
if (!ctx)
return -ENOMEM;
platform_set_drvdata(pdev, ctx);