From patchwork Tue Apr 28 14:09:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 6289691 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 261C49F389 for ; Tue, 28 Apr 2015 14:06:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8469220390 for ; Tue, 28 Apr 2015 14:06:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6C1C820383 for ; Tue, 28 Apr 2015 14:06:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0349B6E0DC; Tue, 28 Apr 2015 07:06:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by gabe.freedesktop.org (Postfix) with ESMTP id E87126E08E for ; Tue, 28 Apr 2015 07:06:41 -0700 (PDT) Received: by wgyo15 with SMTP id o15so152805461wgy.2 for ; Tue, 28 Apr 2015 07:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dvrvEfjkMPcj/7q6yXNohq2IFLIoykI5KmfN5bSga7Q=; b=Zb+OOMoUg/HOc4R4fwuHsvgDJicQB35f1AfDHWQXy7Lqa4ob/txrfF+827CUgHLtT4 EODhmVbCgmJqZJ8E+DlUQW7SlHPg9bEYRUkBl48CWBfh8MSqbAhhcQrSS3XXMxnD8+wP XhzWEphjAX/iC+ojvZVXnLYehO9zIZcDBMsQ7IeS/zxA0WofPtpxqMuPLNZrruE3ucmR NSflfgeEjwA5BOxzN8/t8mL6iL4bcDYa3sP2IkBN41AjprV8wD78zUT/mh5npQ9PG11E 83ax5HiEqImNMcwt71VcHh33dZpwJloAF5rj9vfvzAtxgiaWYD7cRaFAOV/2yZxkevQG Fb3g== X-Received: by 10.180.20.200 with SMTP id p8mr7022539wie.78.1430230000821; Tue, 28 Apr 2015 07:06:40 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by mx.google.com with ESMTPSA id ju2sm16583819wid.12.2015.04.28.07.06.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Apr 2015 07:06:39 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/3] modetest: explicitly zero the newly allocated memory Date: Tue, 28 Apr 2015 15:09:57 +0100 Message-Id: <1430230199-3562-1-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.3.5 Cc: 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 Signed-off-by: Emil Velikov --- tests/modetest/modetest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 7f0c1cc..e4a8bbc 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -1368,8 +1368,6 @@ static int parse_plane(struct plane_arg *plane, const char *p) { char *end; - memset(plane, 0, sizeof *plane); - plane->crtc_id = strtoul(p, &end, 10); if (*end != ':') return -EINVAL; @@ -1541,11 +1539,11 @@ int main(int argc, char **argv) fprintf(stderr, "memory allocation failed\n"); return 1; } + memset(&plane_args[plane_count], 0, sizeof(*plane_args)); if (parse_plane(&plane_args[plane_count], optarg) < 0) usage(argv[0]); - plane_args[plane_count].fb_id = 0; plane_count++; break; case 'p': @@ -1559,6 +1557,7 @@ int main(int argc, char **argv) fprintf(stderr, "memory allocation failed\n"); return 1; } + memset(&pipe_args[count], 0, sizeof(*pipe_args)); if (parse_connector(&pipe_args[count], optarg) < 0) usage(argv[0]); @@ -1578,6 +1577,7 @@ int main(int argc, char **argv) fprintf(stderr, "memory allocation failed\n"); return 1; } + memset(&prop_args[prop_count], 0, sizeof(*prop_args)); if (parse_property(&prop_args[prop_count], optarg) < 0) usage(argv[0]);