Sui Jingfeng
36672dda2e
drm/loongson: Remove a useless check in cursor_plane_atomic_async_check()
Because smatch warnings:
drivers/gpu/drm/loongson/lsdc_plane.c:199
lsdc_cursor_plane_atomic_async_check()
warn: variable dereferenced before check 'state' (see line 180)
vim +/state +199 drivers/gpu/drm/loongson/lsdc_plane.c
174 static int
lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane,
175 struct drm_atomic_state *state)
176 {
177 struct drm_plane_state *new_state;
178 struct drm_crtc_state *crtc_state;
179
180 new_state = drm_atomic_get_new_plane_state(state, plane);
^^^^^
state is dereferenced inside this function
181
182 if (!plane->state || !plane->state->fb) {
183 drm_dbg(plane->dev, "%s: state is NULL\n", plane->name);
184 return -EINVAL;
185 }
186
187 if (new_state->crtc_w != new_state->crtc_h) {
188 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
189 new_state->crtc_w, new_state->crtc_h);
190 return -EINVAL;
191 }
192
193 if (new_state->crtc_w != 64 && new_state->crtc_w != 32) {
194 drm_dbg(plane->dev, "unsupported cursor size: %ux%u\n",
195 new_state->crtc_w, new_state->crtc_h);
196 return -EINVAL;
197 }
198
199 if (state) {
^^^^^
Checked too late!
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202307100423.rV7D05Uq-lkp@intel.com/
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Link: https://patchwork.freedesktop.org/patch/msgid/20230710102411.257970-1-suijingfeng@loongson.cn
2023-07-13 01:24:42 +08:00
..
2023-07-07 09:33:28 +02:00
2023-04-13 13:13:53 -07:00
2023-06-01 20:43:11 -04:00
2023-04-13 13:13:50 -07:00
2023-05-20 17:56:23 +01:00
2023-06-18 12:00:49 +09:00
2023-03-21 20:19:28 -07:00
2023-05-08 15:28:32 +02:00
2023-06-15 19:50:57 -07:00
2023-04-14 15:32:56 +03:00
2023-06-09 14:21:20 -07:00
2023-06-05 17:13:14 -07:00
2023-04-27 16:36:55 -07:00
2023-04-27 16:21:32 -07:00
2023-06-02 17:35:22 -04:00
2023-06-14 17:22:17 -07:00
2023-04-29 10:24:30 -07:00
2023-03-17 15:16:33 +01:00
2023-05-02 10:41:31 -07:00
2023-05-25 19:35:13 +02:00
2023-04-29 13:04:50 -07:00
2023-05-07 10:57:14 -07:00
2023-05-26 13:34:39 -07:00
2023-04-27 19:57:00 -07:00
2023-04-27 11:53:57 -07:00
2023-05-24 11:20:28 +05:30
2023-06-21 20:22:20 +03:00
2023-05-26 20:56:55 -07:00
2023-04-05 15:10:14 -05:00
2023-03-17 15:16:33 +01:00
2023-05-11 09:06:49 +09:00
2023-07-08 20:26:36 +02:00
2023-04-27 12:07:50 -07:00
2023-03-17 15:16:33 +01:00
2023-06-07 14:49:35 +02:00
2023-07-13 01:24:42 +08:00
2023-06-19 16:01:25 +10:00
2023-04-05 19:41:10 +02:00
2023-04-27 10:09:05 -07:00
2023-04-27 17:17:12 -07:00
2023-05-08 11:36:19 +02:00
2023-04-13 13:13:52 -07:00
2023-05-11 11:18:21 +01:00
2023-06-07 12:29:58 +02:00
2023-04-30 23:50:26 +02:00
2023-04-27 19:37:36 +02:00
2023-05-20 17:33:14 +01:00
2023-06-14 14:12:43 -03:00
2023-06-07 13:49:42 -07:00
2023-04-27 16:36:55 -07:00
2023-06-13 00:23:33 +03:00
2023-05-30 11:01:22 +01:00
2023-05-05 19:12:01 -07:00
2023-06-03 17:00:28 +02:00
2023-04-28 16:24:32 -07:00
2023-05-31 13:26:44 -05:00
2023-04-20 14:24:01 +02:00
2023-06-15 20:19:21 -07:00
2023-06-21 20:22:20 +03:00
2023-04-25 12:02:16 -07:00
2023-04-05 11:45:35 +02:00
2023-04-28 14:02:54 -07:00
2023-05-02 10:41:31 -07:00
2023-06-19 16:01:25 +10:00
2023-05-24 14:33:32 +02:00
2023-03-17 15:16:33 +01:00
2023-06-01 18:12:33 +02:00
2023-03-17 15:16:27 +01:00
2023-06-15 21:11:17 -07:00
2023-05-26 12:18:35 +01:00
2023-04-03 21:42:52 +02:00
2023-03-20 15:39:14 +01:00
2023-03-17 15:16:33 +01:00
2023-05-31 09:21:26 -07:00
2023-04-27 16:36:55 -07:00
2023-06-09 16:12:37 -06:00
2023-04-27 10:09:05 -07:00
2023-05-03 17:43:26 +02:00
2023-03-23 12:22:19 +09:00
2023-05-11 17:38:46 -05:00
2023-04-03 21:42:52 +02:00
2023-03-23 13:20:40 +01:00
2023-04-29 13:04:50 -07:00
2023-05-16 19:48:55 +05:30
2023-05-16 15:02:01 +02:00
2023-05-30 12:10:22 +02:00
2023-04-04 10:43:52 -05:00
2023-05-16 23:02:56 +02:00
2023-03-17 15:16:33 +01:00
2023-04-27 11:53:57 -07:00
2023-05-03 11:25:01 -07:00
2023-04-27 19:57:00 -07:00
2023-06-07 14:20:04 +01:00
2023-04-27 19:57:00 -07:00
2023-04-29 17:29:39 -07:00
2023-04-27 11:53:57 -07:00
2023-05-02 10:41:31 -07:00
2023-06-15 21:11:17 -07:00
2023-04-27 11:53:57 -07:00
2023-06-14 21:57:48 -04:00
2023-03-17 15:29:55 +01:00
2023-06-10 13:01:09 -07:00
2023-06-08 17:08:04 +05:30
2023-06-13 20:19:26 +01:00
2023-04-20 14:16:39 +02:00
2023-07-08 20:26:40 +02:00
2023-06-14 21:54:35 -04:00
2023-06-07 12:58:22 +02:00
2023-05-24 19:50:04 +02:00
2023-05-31 10:37:21 +03:00
2023-06-13 12:31:45 +02:00
2023-05-16 21:07:26 -04:00
2023-06-13 12:16:34 +02:00
2023-06-08 15:43:08 -04:00
2023-05-23 14:16:29 -06:00
2023-06-09 12:08:04 -04:00
2023-07-11 13:58:02 +02:00
2023-04-27 10:09:05 -07:00
2023-04-27 19:42:02 -07:00
2023-04-27 12:07:50 -07:00
2023-05-04 18:33:56 -07:00
2023-05-27 09:42:56 -07:00
2023-03-29 12:26:32 +02:00
2023-03-29 12:26:32 +02:00