Skip to content

Commit 08570b7

Browse files
arndbdanvet
authored andcommitted
gpu: host1x: fix uninitialized variable use
The error handling for platform_get_irq() failing no longer works after a recent change, clang now points this out with a warning: drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized] if (syncpt_irq < 0) ^~~~~~~~~~ Fix this by removing the variable and checking the correct error status. Fixes: 625d4ff ("gpu: host1x: Rewrite syncpoint interrupt handling") Reviewed-by: Nathan Chancellor <[email protected]> Reviewed-by: Mikko Perttunen <[email protected]> Reported-by: "kernelci.org bot" <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2e4e9de commit 08570b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/host1x/dev.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ static int host1x_get_resets(struct host1x *host)
487487
static int host1x_probe(struct platform_device *pdev)
488488
{
489489
struct host1x *host;
490-
int syncpt_irq;
491490
int err;
492491

493492
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
@@ -517,8 +516,8 @@ static int host1x_probe(struct platform_device *pdev)
517516
}
518517

519518
host->syncpt_irq = platform_get_irq(pdev, 0);
520-
if (syncpt_irq < 0)
521-
return syncpt_irq;
519+
if (host->syncpt_irq < 0)
520+
return host->syncpt_irq;
522521

523522
mutex_init(&host->devices_lock);
524523
INIT_LIST_HEAD(&host->devices);

0 commit comments

Comments
 (0)