FAILED: patch "[PATCH] media: imx-jpeg: Reset slot data pointers when freed" failed to apply to 5.15-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x faa8051b128f4b34277ea8a026d02d83826f8122
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025062057-sift-mulled-7ea9@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From faa8051b128f4b34277ea8a026d02d83826f8122 Mon Sep 17 00:00:00 2001
From: Ming Qian <[email protected]>
Date: Mon, 21 Apr 2025 16:12:53 +0800
Subject: [PATCH] media: imx-jpeg: Reset slot data pointers when freed
Ensure that the slot data pointers are reset to NULL and handles are set to 0 after freeing the coherent memory. This makes he function mxc_jpeg_alloc_slot_data() and mxc_jpeg_free_slot_data() safe to be called multiple times.
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +6 -0
@@ -758,16 +758,22 @@ static void mxc_jpeg_free_slot_data(struct mxc_jpeg_dev *jpeg)dma_free_coherent (jpeg->dev,sizeof (struct mxc_jpeg_desc ), jpeg->slot_data.desc, jpeg->slot_data.desc_handle); + jpeg->slot_data.desc =NULL ; + jpeg->slot_data.desc_handle =0 ;/* free descriptor for encoder configuration phase / decoder DHT */ dma_free_coherent (jpeg->dev,sizeof (struct mxc_jpeg_desc ), jpeg->slot_data.cfg_desc, jpeg->slot_data.cfg_desc_handle); + jpeg->slot_data.cfg_desc_handle =0 ; + jpeg->slot_data.cfg_desc =NULL ;/* free configuration stream */ dma_free_coherent (jpeg->dev,MXC_JPEG_MAX_CFG_STREAM , jpeg->slot_data.cfg_stream_vaddr, jpeg->slot_data.cfg_stream_handle); + jpeg->slot_data.cfg_stream_vaddr =NULL ; + jpeg->slot_data.cfg_stream_handle =0 ; jpeg->slot_data.used = false; }