From patchwork Mon Jul 1 08:00:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 2806141 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 187BBBF4A1 for ; Mon, 1 Jul 2013 08:00:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC77E20118 for ; Mon, 1 Jul 2013 08:00:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 165A9200ED for ; Mon, 1 Jul 2013 08:00:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B4F2FE5E04 for ; Mon, 1 Jul 2013 01:00:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id B2847E5C82 for ; Mon, 1 Jul 2013 01:00:36 -0700 (PDT) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MP8006HWZGE6GH0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 01 Jul 2013 17:00:35 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id F2.CF.11618.22731D15; Mon, 01 Jul 2013 17:00:34 +0900 (KST) X-AuditID: cbfee691-b7fef6d000002d62-4b-51d13722633f Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 60.C7.21068.22731D15; Mon, 01 Jul 2013 17:00:34 +0900 (KST) Received: from localhost.localdomain ([10.90.8.56]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MP8006YYZKX8RO1@mmp1.samsung.com>; Mon, 01 Jul 2013 17:00:34 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH] drm/exynos: add error check routine in exynos_drm_open Date: Mon, 01 Jul 2013 17:00:47 +0900 Message-id: <1372665647-13749-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsWyRsSkUFfJ/GKgwfrFVha9504yWVz5+p7N YtL9CSwWL+5dZLE42/SG3WLG5JdsFnt3TmZ0YPfY/u0Bq8f97uNMHn1bVjEGMEdx2aSk5mSW pRbp2yVwZexsn8JYMJGron3eatYGxhMcXYwcHBICJhJ/Npd0MXICmWISF+6tZ+ti5OIQEljK KLHw3lRmiISJxLN3c6ESixgl7nzexwjhNDNJvJxxhhGkik1AR2L/kt+sILaIgKXEg62/wbqZ BSokDt36wwRiCwu4SyyaehAsziKgKnH3yBUWEJtXwE3i4NMvjBDbFCQW3HsLtk1C4DubxJOZ N1ggGgQkvk0+xAJxtqzEpgNQ10lKHFxxg2UCo+ACRoZVjKKpBckFxUnpRaZ6xYm5xaV56XrJ +bmbGIFBevrfs4k7GO8fsD7EmAw0biKzlGhyPjDI80riDY3NjCxMTUyNjcwtzUgTVhLnVW+x DhQSSE8sSc1OTS1ILYovKs1JLT7EyMTBKdXAOO2StvsWz6LP1yUinZ71uS2VmCA9QV5Kkvdg 78FY2zcRMx9P/2ZjoS+UwZR4Y9IiwS6RgO17P3s/fVD2euasW8dfTdRfbyRtpxcmzsWS3Xfx nM6uOcHMu3/vTdx9RG5Nm0fZ3ZhlzVvM2buju+Lb13+UnCp9Kzmj3GP1Ei9POV6fn2V7dZgK lFiKMxINtZiLihMBNIve82gCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsVy+t9jAV0l84uBBlv+GFn0njvJZHHl63s2 i0n3J7BYvLh3kcXibNMbdosZk1+yWezdOZnRgd1j+7cHrB73u48zefRtWcUYwBzVwGiTkZqY klqkkJqXnJ+SmZduq+QdHO8cb2pmYKhraGlhrqSQl5ibaqvk4hOg65aZA7ReSaEsMacUKBSQ WFyspG+HaUJoiJuuBUxjhK5vSBBcj5EBGkhYw5ixs30KY8FEror2eatZGxhPcHQxcnJICJhI PHs3lw3CFpO4cG89kM3FISSwiFHizud9jBBOM5PEyxlnGEGq2AR0JPYv+c0KYosIWEo82Pqb GcRmFqiQOHTrDxOILSzgLrFo6kGwOIuAqsTdI1dYQGxeATeJg0+/MEJsU5BYcO8t2wRG7gWM DKsYRVMLkguKk9JzjfSKE3OLS/PS9ZLzczcxgqPgmfQOxlUNFocYBTgYlXh4F0y/ECjEmlhW XJl7iFGCg1lJhHf75/OBQrwpiZVVqUX58UWlOanFhxiTgbZPZJYSTc4HRmheSbyhsYmZkaWR uaGFkbE5acJK4rwHW60DhQTSE0tSs1NTC1KLYLYwcXBKNTCqrXnn1msSZ7vX9jTHY4/k3CVx s77MW9r+PrIv3mjpJr4957i/vrfRTItUbjx0+aiQackWuym2u+K4Hh/Y+ux3kDHHZ/dZbvNv VzSe//7OfuM0jrYnAfeaQ95tSpyd1X47Tb7sofjyWpZbXVKvViTGXb/1U7tANKp9zsuIqpR8 d499RtuV7tUqsRRnJBpqMRcVJwIA5R13eMYCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com, yj44.cho@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: YoungJun Cho When the exynos_drm_subdrv_open() returns error, the file_priv should be released and file->driver_priv set to NULL. Signed-off-by: YoungJun Cho Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 2762373..ca2729a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -155,6 +155,7 @@ static int exynos_drm_unload(struct drm_device *dev) static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) { struct drm_exynos_file_private *file_priv; + int ret; file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); if (!file_priv) @@ -162,7 +163,13 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) file->driver_priv = file_priv; - return exynos_drm_subdrv_open(dev, file); + ret = exynos_drm_subdrv_open(dev, file); + if (ret) { + kfree(file_priv); + file->driver_priv = NULL; + } + + return ret; } static void exynos_drm_preclose(struct drm_device *dev,