From patchwork Thu Nov 22 14:24:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 1791661 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 75EA7DF24C for ; Thu, 22 Nov 2012 22:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753951Ab2KVW0h (ORCPT ); Thu, 22 Nov 2012 17:26:37 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:30759 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753513Ab2KVSf0 (ORCPT ); Thu, 22 Nov 2012 13:35:26 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDW00JDV81TFBD0@mailout1.samsung.com>; Thu, 22 Nov 2012 23:25:05 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-ef-50ae35c020ee Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 06.69.12699.0C53EA05; Thu, 22 Nov 2012 23:25:05 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDW00MKK81GMB80@mmp2.samsung.com>; Thu, 22 Nov 2012 23:25:04 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: sw0312.kim@samsung.com, Sylwester Nawrocki , stable@vger.kernel.org, Kyungmin Park Subject: [PATCH v2 2/2] fimc-lite: Don't use mutex_lock_interruptible() in device release() Date: Thu, 22 Nov 2012 15:24:49 +0100 Message-id: <1353594289-7381-2-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1353594289-7381-1-git-send-email-s.nawrocki@samsung.com> References: <1353594289-7381-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsVy+t9jQd2DpusCDJ7eZ7Xo2bCV1WLBxkeM DkwenzfJBTBGcdmkpOZklqUW6dslcGXMmvmcteAcZ8XC9W+ZGxhnc3QxcnJICJhIXGpexwRh i0lcuLeerYuRi0NIYDqjxMaWTewQTgeTxPL9c1hAqtgEDCV6j/YxgtgiAvIST3pvgHUwC/Qw Suz9+gCsSFggVuLlzStsIDaLgKrEuUvXgWwODl4BV4n7DVwgpoSAgsScSTYgFZwCbhI3Zt4E O0IIqOL5s6lMExh5FzAyrGIUTS1ILihOSs810itOzC0uzUvXS87P3cQI9v0z6R2MqxosDjEK cDAq8fBmGKwNEGJNLCuuzD3EKMHBrCTCm6O/LkCINyWxsiq1KD++qDQntfgQozQHi5I4b7NH SoCQQHpiSWp2ampBahFMlomDU6qBMdWP7w3j4bMN6pFv3+Zm8eYsPfDOQM4+tWozz58s12wO t93TXde01kUzfH2oq7+j4sidrm+Z3moNenGuIhs7dxy7GiT3wTfz0oGXqYzTt958tODTxott vHcfr0phOtjFWWWrZLbYT2n2lTr7p5Njj93dK9MY+uHEssJ9ClM0Y5fzf8o7nLg9QomlOCPR UIu5qDgRAFktIS75AQAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use uninterruptible mutex_lock in the release() file op to make sure all resources are properly freed when a process is being terminated. Returning -ERESTARTSYS has no effect for a terminating process and this may cause driver resources not to be released. This patch is required for stable kernels v3.5+. Cc: stable@vger.kernel.org Reported-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/s5p-fimc/fimc-lite.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c index 23f203e..1b309a7 100644 --- a/drivers/media/platform/s5p-fimc/fimc-lite.c +++ b/drivers/media/platform/s5p-fimc/fimc-lite.c @@ -491,8 +491,7 @@ static int fimc_lite_close(struct file *file) struct fimc_lite *fimc = video_drvdata(file); int ret; - if (mutex_lock_interruptible(&fimc->lock)) - return -ERESTARTSYS; + mutex_lock(&fimc->lock); if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) { clear_bit(ST_FLITE_IN_USE, &fimc->state);