From 720f7a7850556f8d9ed6069cbcfd9b34b105e04a Mon Sep 17 00:00:00 2001 From: Amitoj Kaur Chawla Date: Sat, 12 Mar 2016 00:11:47 +0530 Subject: [PATCH] staging: most: hdm-usb: Remove invalid reference error commit e3479f77("staging: most: hdm-usb: Remove create_workqueue()") cancel_work_sync(&anchor->clear_work_obj) is introduced after freeing `anchor` causing a invalid reference error. This patch removes this error by shifting the call to cancel_work_sync before freeing `anchor`. Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/hdm-usb/hdm_usb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index 78031abaf857..aeae071f2823 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -221,11 +221,10 @@ static void free_anchored_buffers(struct most_dev *mdev, unsigned int channel) } spin_lock_irqsave(&mdev->anchor_list_lock[channel], flags); list_del(&anchor->list); + cancel_work_sync(&anchor->clear_work_obj); kfree(anchor); } spin_unlock_irqrestore(&mdev->anchor_list_lock[channel], flags); - - cancel_work_sync(&anchor->clear_work_obj); } /**