From patchwork Wed Jan 10 02:16:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 10153815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABAF1602D8 for ; Wed, 10 Jan 2018 02:16:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D26C2833E for ; Wed, 10 Jan 2018 02:16:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81A0A28358; Wed, 10 Jan 2018 02:16:31 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 724732833E for ; Wed, 10 Jan 2018 02:16:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D3098979E; Wed, 10 Jan 2018 02:16:29 +0000 (UTC) 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 ESMTPS id B041E8979E for ; Wed, 10 Jan 2018 02:16:27 +0000 (UTC) Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180110021623epoutp01d0d6f4295918a5b439b5208bb05d2c00~IUTnt6gvt2402624026epoutp01m; Wed, 10 Jan 2018 02:16:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180110021623epoutp01d0d6f4295918a5b439b5208bb05d2c00~IUTnt6gvt2402624026epoutp01m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1515550583; bh=NTm2vsRl8nzoyxfoMNyIzte36HFDUjkKVMND5gw9g2M=; h=From:To:Cc:Subject:Date:References:From; b=Ud8r+YpciKalcn2wzgGB2/9Mg9LRGhGtvpWYx+1Us/4iU0yS38+QHFpsFsensC1eA 345QgjsmcGHFVvYIE6wppAVWvmJ1fFa5rxOO20gaCPazCKxD5gmymlFi2zcrNDOvjB jFHx1cQJdbrGS7op+IIZZbyozcuTv4nHEL1NY+R0= Received: from epsmges1p4.samsung.com (unknown [182.195.40.64]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180110021623epcas1p41ebc013b11870ceb254322c58c30bea9~IUTneHlnv0436304363epcas1p4g; Wed, 10 Jan 2018 02:16:23 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id F3.31.04483.777755A5; Wed, 10 Jan 2018 11:16:23 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180110021623epcas1p2e9aaf571b99cd306a066bdc80822a84a~IUTnSqasO1295612956epcas1p2y; Wed, 10 Jan 2018 02:16:23 +0000 (GMT) X-AuditID: b6c32a38-ec5ff70000001183-83-5a55777739a9 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C0.62.04148.777755A5; Wed, 10 Jan 2018 11:16:23 +0900 (KST) Received: from localhost.localdomain ([10.113.77.108]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P2B009ZAIB96G10@mmp1.samsung.com>; Wed, 10 Jan 2018 11:16:23 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm] modetest: Fix to check return value of asprintf() Date: Wed, 10 Jan 2018 11:16:41 +0900 Message-id: <1515550601-1453-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLIsWRmVeSWpSXmKPExsWy7bCmrm55eWiUwdJuZYsrX9+zWey5eo/J Ysbkl2wOzB47Z91l97jffZzJo2/LKsYA5qhUm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwND XUNLC3MlhbzE3FRbJRefAF23zBygTUoKZYk5pUChgMTiYiV9O5ui/NKSVIWM/OISW6VoQ0Mj PUMDcz0jIyM9E+NYKyNToJKE1Iye3RfYCs6zV7z/od/AuICti5GTQ0LARGLbn7WMXYxcHEIC OxglXl06wwbhfGeUOP/yKlzVzG3ToBK7GSX+tz2HavnBKPFi2ixmkCo2AR2J/Ut+s4LYIgLK En8nrmIEsZmBuh8v3s8EYgsLeEp0bb0HVs8ioCox8/hnFhCbV8BVYtPC+SwQ2xQkFtx7C7ZN QuAoq8SB451AgziAHBeJngPVEDXCEq+Ob2GHCEtLXDpqCxFuZ5RYdi0AonUKo8Suq5uYIBLG Es8WdjFB3MMn8e5rDytEL69ER5sQRImHROeMF8wQtqPE+al9YM8LCcRK9B/rZ53AKLmAkWEV o1hqQXFuemqxYYGJXnFibnFpXrpecn7uJkZw1GtZ7GDcc87nEKMAB6MSD++HGyFRQqyJZcWV uYcYJTiYlUR4fecHRwnxpiRWVqUW5ccXleakFh9iNAWGxkRmKdHkfGBCyiuJNzSxNDAxMwLG vqWhoZI4b0CAS5SQQHpiSWp2ampBahFMHxMHp1QDI+NqNZYZKiesmT5pf0r47+p5vk1iVvLc LKX7c7ctOl6YdkX6zc4zPFbF8/xyFqru+nna88+OyqKd52O61u1z7xf5GG+dPn3NJ+dCZ/l5 njpLdvtvitnzRcFl0vEfdqfkheax1di1se+8tCsj6NIS6athlyIW+HycJcy/acrHgJZHfMwb BKWSCpVYijMSDbWYi4oTASGxGecQAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGJMWRmVeSWpSXmKPExsVy+t9jAd3y8tAogw9XRC2ufH3PZrHn6j0m ixmTX7I5MHvsnHWX3eN+93Emj74tqxgDmKO4bFJSczLLUov07RK4Mnp2X2ArOM9e8f6HfgPj ArYuRk4OCQETiZnbpgHZXBxCAjsZJZZ++8QK4fxglHj26SEjSBWbgI7E/iW/WUFsEQFlib8T V4HFmYG6Hy/ezwRiCwt4SnRtvccMYrMIqErMPP6ZBcTmFXCV2LRwPgvENgWJBffesk1g5FrA yLCKUTK1oDg3PbfYqMAwL7Vcrzgxt7g0L10vOT93EyPQt9sOa/XtYLy/JP4QowAHoxIPr8ft kCgh1sSy4srcQ4wSHMxKIry+84OjhHhTEiurUovy44tKc1KLDzFKc7AoifPezjsWKSSQnliS mp2aWpBaBJNl4uCUamBk4lT91VXp7DP3m27PA7PV+6u3SC7/deba9C0pHz8UNJxY+9lj5/pT lsK3M5793htl7t113Obu/xsrHm36dLd8eYybSGaCsmO9uiaju5nE1rWZpZm173Z3GjAq/RMo 9xbemD9x00J+g606Z1IdbpRtLT70PSbt5sp9qzJ9GXtEu367S89rTFqhxFKckWioxVxUnAgA yauSuekBAAA= X-CMS-MailID: 20180110021623epcas1p2e9aaf571b99cd306a066bdc80822a84a X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20180110021623epcas1p2e9aaf571b99cd306a066bdc80822a84a X-RootMTR: 20180110021623epcas1p2e9aaf571b99cd306a066bdc80822a84a References: Cc: sw0312.kim@samsung.com, emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP There is warning about ignoring return value of 'asprintf'. Fix to check return value of asprintf(). Signed-off-by: Seung-Woo Kim Reviewed-by: Eric Engestrom --- tests/modetest/modetest.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 62d9332..0773bd0 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -656,10 +656,13 @@ static struct resources *get_resources(struct device *dev) for (i = 0; i < res->res->count_connectors; i++) { struct connector *connector = &res->connectors[i]; drmModeConnector *conn = connector->connector; + int num; - asprintf(&connector->name, "%s-%u", + num = asprintf(&connector->name, "%s-%u", util_lookup_connector_type_name(conn->connector_type), conn->connector_type_id); + if (num < 0) + goto error; } #define get_properties(_res, __res, type, Type) \