From patchwork Mon Apr 29 09:10:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 10921463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 341D792A for ; Mon, 29 Apr 2019 09:10:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20CE728578 for ; Mon, 29 Apr 2019 09:10:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 149C3285E3; Mon, 29 Apr 2019 09:10:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD60F28578 for ; Mon, 29 Apr 2019 09:10:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3681A892C1; Mon, 29 Apr 2019 09:10:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B728892BD for ; Mon, 29 Apr 2019 09:09:59 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190429090957epoutp049a9bdf4a1abd04a4d9361007013cbd58~Z5uBvpKS30328203282epoutp043 for ; Mon, 29 Apr 2019 09:09:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190429090957epoutp049a9bdf4a1abd04a4d9361007013cbd58~Z5uBvpKS30328203282epoutp043 Received: from epsmges1p3.samsung.com (unknown [182.195.40.158]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20190429090955epcas1p1be0a95ea92eaf36199294cb5e6d59e49~Z5t-Vvojz0281302813epcas1p1M; Mon, 29 Apr 2019 09:09:55 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id B7.91.04143.06FB6CC5; Mon, 29 Apr 2019 18:09:52 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20190429090952epcas1p4877cf8476a69f756a1a6bfe9d6d52abd~Z5t8cKfwh2247422474epcas1p4Z; Mon, 29 Apr 2019 09:09:52 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190429090952epsmtrp142698fa12934525f1454a89205f4dd06~Z5t8blZap2678026780epsmtrp1Y; Mon, 29 Apr 2019 09:09:52 +0000 (GMT) X-AuditID: b6c32a37-f19ff7000000102f-7f-5cc6bf60d6d7 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id F2.30.03662.06FB6CC5; Mon, 29 Apr 2019 18:09:52 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.222]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190429090951epsmtip26fdefb14e0ba6b8b88a5c581e4954a38~Z5t8Rkwxo0471704717epsmtip2j; Mon, 29 Apr 2019 09:09:51 +0000 (GMT) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] xf86drm: Fix possible memory leak with drmModeGetPropertyPtr() Date: Mon, 29 Apr 2019 18:10:52 +0900 Message-Id: <1556529052-6413-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCKsWRmVeSWpSXmKPExsWy7bCmnm7C/mMxBjt/yVhc+fqezWLP1XtM FjMmv2RzYPbYOesuu8f97uNMHn1bVjEGMEdl22SkJqakFimk5iXnp2TmpdsqeQfHO8ebmhkY 6hpaWpgrKeQl5qbaKrn4BOi6ZeYAbVJSKEvMKQUKBSQWFyvp29kU5ZeWpCpk5BeX2CqlFqTk FFgW6BUn5haX5qXrJefnWhkaGBiZAhUmZGcsX7CbqWApa8XRJ/MZGxiXsnQxcnJICJhITH+z iKmLkYtDSGAHo8S52X3sEM4nRoklPcuhnG+MErfvXGeEaZnxvpkNIrGXUaJrVjcrhPOFUaJ/ 9hKwKjYBHYn9S36zgtgiAsoSfyeuAoszA3U/XryfCcQWFoiQmLqmkRnEZhFQlejq+A5m8wq4 Sny58J0JYpuCxIJ7b8G2SQjcZJXYvOgZ1BkuEvs3/GGDsIUlXh3fwg5hS0m87G+Dsqsltk/4 yQ7R3MEo0dPeCPW2scT+pZOBNnAAXaQpsX6XPsRxfBLvvvawgoQlBHglOtqEIKpVJHYencQG EZaSmLUhGCLsITF7wh2wC4QEYiXmrdzONIFRZhbCzAWMjKsYxVILinPTU4sNC4yRY2YTIzjF aJnvYNxwzucQowAHoxIPr8KrozFCrIllxZW5hxglOJiVRHg9jgOFeFMSK6tSi/Lji0pzUosP MZoCA2wis5Rocj4w/eWVxBuaGhkbG1uYGJqZGhoqifOud3COERJITyxJzU5NLUgtgulj4uCU amCUl5UPnH+7nrXB9HfwggMz6n5GzjqaxCzPlNio2vaXyeaTUH979vcV29h4c9/1v4pYkWGm PCEj8Vq3lUXtYpbM6a/uRq2/fm1CUkrPU56fupvYJgsseXnkZI/QciVXod03lv3RYtg5789t 7c+CU9+1/zy05Fz3yt2lAmL5L7vjVISkaw5qZK1VYinOSDTUYi4qTgQA1qrdLEcDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsWy7bCSvG7C/mMxBos/s1pc+fqezWLP1XtM FjMmv2RzYPbYOesuu8f97uNMHn1bVjEGMEdx2aSk5mSWpRbp2yVwZSxfsJupYClrxdEn8xkb GJeydDFyckgImEjMeN/M1sXIxSEksJtR4t+Ft4wQCSmJud+2A9kcQLawxOHDxRA1nxglpuy5 wwpSwyagI7F/yW8wW0RAWeLvxFVgvcwCZhJrpq8Gs4UFwiQOzZkIVsMioCrR1fGdGcTmFXCV +HLhOxPELgWJBffesk1g5FnAyLCKUTK1oDg3PbfYsMAoL7Vcrzgxt7g0L10vOT93EyM4FLS0 djCeOBF/iFGAg1GJh/fE86MxQqyJZcWVuYcYJTiYlUR4PY4DhXhTEiurUovy44tKc1KLDzFK c7AoifPK5x+LFBJITyxJzU5NLUgtgskycXBKNTAqizxoyXFK6A2/sto952vo6z26y2tliya6 2Kza2/7jloLCrqRHNty+u8L3XOaK3vk+72GYA9u/6IdZ7287NnwwFpL7IBBjn6tuPWmC4v/V l3h1nk6ZtdSl4Z9R7Fll1rj2/QGLUv8lJDf5WqZ0P/+0svn5/5un83NyZLo8XtQcM1v4PTPl s7USS3FGoqEWc1FxIgAZ62c7AQIAAA== X-CMS-MailID: 20190429090952epcas1p4877cf8476a69f756a1a6bfe9d6d52abd X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190429090952epcas1p4877cf8476a69f756a1a6bfe9d6d52abd References: X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1556528997; bh=b19joHUU6ZwR9nhOqRFskPBIXE7EClSq1z+obHggW44=; h=From:To:Cc:Subject:Date:References:From; b=p7v79WHxJUU+cYBN4rWscIBtEK41N+OUWutbCjzCO5oUXyTXiTdThYGinaJAQA4UJ 0ZSEfTadNvr3jwGQLLxvu1yvt5mCccZ7ahjFfjCxsBxMizXmQAGUT2BCyc8uUbh/DN FZKW6FMQgbSJPr0+Sd9jLsdh48h2Z8Xs6YnJoT+Q= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw0312.kim@samsung.com, emil.l.velikov@gmail.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In drmModeGetPropertyPtr(), from upper error path, it calls free but with just next error path, it does not call. Fix the possible memory leak. Signed-off-by: Seung-Woo Kim Reviewed-by: Eric Engestrom --- xf86drmMode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/xf86drmMode.c b/xf86drmMode.c index c878d9e..207d7be 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -650,7 +650,7 @@ drm_public drmModePropertyPtr drmModeGetProperty(int fd, uint32_t property_id) } if (!(r = drmMalloc(sizeof(*r)))) - return NULL; + goto err_allocs; r->prop_id = prop.prop_id; r->count_values = prop.count_values;