Skip to content

Commit

Permalink
firmware: tegra: adjust tested variable
Browse files Browse the repository at this point in the history
Check the variable that was most recently initialized.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x, y, f, g, e, m;
statement S1,S2,S3,S4;
@@

x = f(...);
if (\(<+...x...+>\&e\)) S1 else S2
(
x = g(...);
|
m = g(...,&x,...);
|
y = g(...);
*if (e)
 S3 else S4
)
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Reviewed-by: Mikko Perttunen <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
  • Loading branch information
JuliaLawall authored and thierryreding committed Mar 8, 2018
1 parent 1abb081 commit 1320f76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/tegra/bpmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
}

bpmp->rx.virt = gen_pool_dma_alloc(bpmp->rx.pool, 4096, &bpmp->rx.phys);
if (!bpmp->rx.pool) {
if (!bpmp->rx.virt) {
dev_err(&pdev->dev, "failed to allocate from RX pool\n");
err = -ENOMEM;
goto free_tx;
Expand Down

0 comments on commit 1320f76

Please sign in to comment.