Skip to content

Commit

Permalink
mailbox: xgene-slimpro: Fix wrong test for devm_kzalloc
Browse files Browse the repository at this point in the history
devm_kzalloc() returns NULL on failure.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
Axel Lin authored and Jassi Brar committed Apr 8, 2016
1 parent 3c96888 commit a61b37e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mailbox/mailbox-xgene-slimpro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a61b37e

Please sign in to comment.