dma-buf: dma-buf-cache: fix error condition for cache fail

Fixes: 43d1db61b0 ("dma-buf: dma-buf-cache: fix error case for attach / detach")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Idc5a052bb3c2ee1c3ae45dbeac8d57178595a22f
This commit is contained in:
Jianqun Xu
2022-01-05 14:41:45 +08:00
committed by Tao Huang
parent a6a2d02704
commit 8bda65645d

View File

@@ -119,7 +119,7 @@ struct dma_buf_attachment *dma_buf_cache_attach(struct dma_buf *dmabuf,
/* Cache attachment */
attach = dma_buf_attach(dmabuf, dev);
if (!IS_ERR_OR_NULL(attach)) {
if (IS_ERR_OR_NULL(attach)) {
kfree(cache);
return attach;
}