aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tiny/simpledrm.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2021-05-20 13:30:27 +1000
committerDave Airlie <airlied@redhat.com>2021-05-20 13:31:12 +1000
commitae25ec2fc6c5a9e5767bf1922cd648501d0f914c (patch)
treecb07d9b3b578723cdc657c85760758db7bd28c15 /drivers/gpu/drm/tiny/simpledrm.c
parent41ab70e06e13f81f0da76c5e0734c9bd32b5a4d9 (diff)
parent30039405ac25665119ff7bc944d33b136ef1c8a9 (diff)
Merge tag 'drm-misc-next-2021-05-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.14: UAPI Changes: Cross-subsystem Changes: Core Changes: * aperture: Fix unlocking on errors * legacy: Fix some doc comments Driver Changes: * drm/amdgpu: Free resource on fence usage query; Fix fence calculation; * drm/bridge: Lt9611: Add missing MODULE_DEVICE_TABLE * drm/i915: Print formats with %p4cc * drm/ingenic: IPU planes are now always of type OVERLAY * drm/nouveau: Remove left-over reference to struct drm_device.pdev * drm/panfrost: Disable devfreq if num_supplies > 1; Add Mediatek MT8183 + DT bindings; Cleanups * drm/simpledrm: Print resources with %pr; Fix use-after-free errors; Fix NULL deref; Fix MAINTAINERS entry * drm/vmwgfx: Fix memory allocation and leak in FIFO allocation; Fix return value in PCI resource setup Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/YKJs2IfwSYvuGPU7@linux-uq9g.fritz.box
Diffstat (limited to 'drivers/gpu/drm/tiny/simpledrm.c')
-rw-r--r--drivers/gpu/drm/tiny/simpledrm.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c
index 2bdb477d9326..4f605c5fe856 100644
--- a/drivers/gpu/drm/tiny/simpledrm.c
+++ b/drivers/gpu/drm/tiny/simpledrm.c
@@ -72,6 +72,7 @@ simplefb_get_validated_format(struct drm_device *dev, const char *format_name)
static const struct simplefb_format formats[] = SIMPLEFB_FORMATS;
const struct simplefb_format *fmt = formats;
const struct simplefb_format *end = fmt + ARRAY_SIZE(formats);
+ const struct drm_format_info *info;
if (!format_name) {
drm_err(dev, "simplefb: missing framebuffer format\n");
@@ -79,8 +80,12 @@ simplefb_get_validated_format(struct drm_device *dev, const char *format_name)
}
while (fmt < end) {
- if (!strcmp(format_name, fmt->name))
- return drm_format_info(fmt->fourcc);
+ if (!strcmp(format_name, fmt->name)) {
+ info = drm_format_info(fmt->fourcc);
+ if (!info)
+ return ERR_PTR(-EINVAL);
+ return info;
+ }
++fmt;
}
@@ -298,6 +303,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 +421,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;
@@ -530,8 +537,8 @@ static int simpledrm_device_init_mm(struct simpledrm_device *sdev)
ret = devm_aperture_acquire_from_firmware(dev, mem->start, resource_size(mem));
if (ret) {
- drm_err(dev, "could not acquire memory range [0x%llx:0x%llx]: error %d\n",
- mem->start, mem->end, ret);
+ drm_err(dev, "could not acquire memory range %pr: error %d\n",
+ mem, ret);
return ret;
}