summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-05-12 21:30:51 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2021-05-13 16:00:54 +0200
commit0ff9bf9f3e0ce212aabea84365575466039e8c46 (patch)
treeda3997f970ac109983f5143339442d76b27e3e68
parent858aa5a4be22368f8d0e8ace7dc0b5ffb62bbdbc (diff)
drm: simpledrm: Fix use after free issues
There are two occurrances where objects are being free'd via a put call and yet they are being referenced after this. Fix these by adding in the missing continue statement so that the put on the end of the loop is skipped over. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Addresses-Coverity: ("Use after free") Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Link: https://patchwork.freedesktop.org/patch/msgid/20210512203051.299026-1-colin.king@canonical.com
-rw-r--r--drivers/gpu/drm/tiny/simpledrm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 00e118c6e2e8..f72ca3a1c2d4 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -298,6 +298,7 @@ static int simpledrm_device_init_clocks(struct simpledrm_device *sdev)
drm_err(dev, "failed to enable clock %u: %d\n",
i, ret);
clk_put(clock);
+ continue;
}
sdev->clks[i] = clock;
}
@@ -415,6 +416,7 @@ static int simpledrm_device_init_regulators(struct simpledrm_device *sdev)
drm_err(dev, "failed to enable regulator %u: %d\n",
i, ret);
regulator_put(regulator);
+ continue;
}
sdev->regulators[i++] = regulator;