Skip to content

Commit 1e7b581

Browse files
committed
Merge tag 'drm-misc-fixes-2021-07-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Short summary of fixes pull: * dma-buf: Fix fence leak in sync_file_merge() error code * drm/panel: nt35510: Don't fail on DSI reads Signed-off-by: Daniel Vetter <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YO07pEfweKVO+7y0@linux-uq9g
2 parents e73f0f0 + ffe0002 commit 1e7b581

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

drivers/dma-buf/sync_file.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
211211
struct sync_file *b)
212212
{
213213
struct sync_file *sync_file;
214-
struct dma_fence **fences, **nfences, **a_fences, **b_fences;
215-
int i, i_a, i_b, num_fences, a_num_fences, b_num_fences;
214+
struct dma_fence **fences = NULL, **nfences, **a_fences, **b_fences;
215+
int i = 0, i_a, i_b, num_fences, a_num_fences, b_num_fences;
216216

217217
sync_file = sync_file_alloc();
218218
if (!sync_file)
@@ -236,7 +236,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
236236
* If a sync_file can only be created with sync_file_merge
237237
* and sync_file_create, this is a reasonable assumption.
238238
*/
239-
for (i = i_a = i_b = 0; i_a < a_num_fences && i_b < b_num_fences; ) {
239+
for (i_a = i_b = 0; i_a < a_num_fences && i_b < b_num_fences; ) {
240240
struct dma_fence *pt_a = a_fences[i_a];
241241
struct dma_fence *pt_b = b_fences[i_b];
242242

@@ -277,15 +277,16 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
277277
fences = nfences;
278278
}
279279

280-
if (sync_file_set_fence(sync_file, fences, i) < 0) {
281-
kfree(fences);
280+
if (sync_file_set_fence(sync_file, fences, i) < 0)
282281
goto err;
283-
}
284282

285283
strlcpy(sync_file->user_name, name, sizeof(sync_file->user_name));
286284
return sync_file;
287285

288286
err:
287+
while (i)
288+
dma_fence_put(fences[--i]);
289+
kfree(fences);
289290
fput(sync_file->file);
290291
return NULL;
291292

drivers/gpu/drm/panel/panel-novatek-nt35510.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,7 @@ static int nt35510_power_on(struct nt35510 *nt)
706706
if (ret)
707707
return ret;
708708

709-
ret = nt35510_read_id(nt);
710-
if (ret)
711-
return ret;
709+
nt35510_read_id(nt);
712710

713711
/* Set up stuff in manufacturer control, page 1 */
714712
ret = nt35510_send_long(nt, dsi, MCS_CMD_MAUCCTR,

0 commit comments

Comments
 (0)