Skip to content

Commit 768ed82

Browse files
committed
Revert "FROMLIST: misc: fastrpc: Allow fastrpc_buf_free() to accept NULL"
This change corresponds to the v4 version shared with the upstream community. Revert it to apply the complete v6 revision, which includes additional fixes and updates not present in the earlier version. This reverts commit e0ba718. Signed-off-by: Vinayak Katoch <vkatoch@qti.qualcomm.com>
1 parent f5f3138 commit 768ed82

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/misc/fastrpc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ static void fastrpc_context_free(struct kref *ref)
585585
for (i = 0; i < ctx->nbufs; i++)
586586
fastrpc_map_put(ctx->maps[i]);
587587

588-
fastrpc_buf_free(ctx->buf);
588+
if (ctx->buf)
589+
fastrpc_buf_free(ctx->buf);
589590

590591
spin_lock_irqsave(&cctx->lock, flags);
591592
idr_remove(&cctx->ctx_idr, FIELD_GET(FASTRPC_CTXID_MASK, ctx->ctxid));
@@ -1728,7 +1729,8 @@ static int fastrpc_device_release(struct inode *inode, struct file *file)
17281729
list_del(&fl->user);
17291730
spin_unlock_irqrestore(&cctx->lock, flags);
17301731

1731-
fastrpc_buf_free(fl->init_mem);
1732+
if (fl->init_mem)
1733+
fastrpc_buf_free(fl->init_mem);
17321734

17331735
list_for_each_entry_safe(ctx, n, &fl->pending, node) {
17341736
list_del(&ctx->node);

0 commit comments

Comments
 (0)