From patchwork Fri May 13 06:14:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Nicolai_H=C3=A4hnle?= X-Patchwork-Id: 9088091 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 527C89F1C3 for ; Fri, 13 May 2016 06:14:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 766142012D for ; Fri, 13 May 2016 06:14:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A4E7320212 for ; Fri, 13 May 2016 06:14:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 747496EA2B; Fri, 13 May 2016 06:14:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x244.google.com (mail-yw0-x244.google.com [IPv6:2607:f8b0:4002:c05::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 97C4B6EA27 for ; Fri, 13 May 2016 06:14:47 +0000 (UTC) Received: by mail-yw0-x244.google.com with SMTP id i22so10082017ywc.1 for ; Thu, 12 May 2016 23:14:47 -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:mime-version :content-transfer-encoding; bh=K+CKviWz765ADrmyZIc9h8bL5iEJLIaZMWJk90NrYJc=; b=TrhjhGrXB3dgqx1omExyDHLVVizczUAV6C+z9k6EwZnXJnvC/l53rBzVR3YlxgxTSO 8VlrsIchNYqQsfTj+kKzhGkLXCfQolhBV0v4Zhh9mWbXZ5m7fQLTioAXEmWj6QYwmsEy lrxFLjgfX+z9GAtLUnXtpk34CJIIeHcaE+t4ev5LqKxNEFnDWdz8pZTwLA4I/X37gyRj PmuzGvRdyok4kN7FaDtszRwKA8rSfbV5SI0/YP3X4tSUIvbP2zIsQN/RPuEGFm6zehrF Kpkyg1QgthhpXyUO3EUsb0+nrZQoBs0vhRiIfmPoEZH73oKGQXGKbHSF3FAa0XeGCv+b GqmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K+CKviWz765ADrmyZIc9h8bL5iEJLIaZMWJk90NrYJc=; b=l0FhRB1vKIBKsReMbm60FJ75BXqKJ3gg6MjsLkdpYfUatGXZT2YPkvBftef1c08mev riH0Tl1gH4RijJsKnekBuRieGoFOPsVFWzbvjUhdvuB6xRnJqbdZQJu3Kp1NwC2VC4FG MesYkrhbOuLNOvVy+NVzUbzUvbnYLEeJT2zOX1madJI/nQLwjiZyQe3FF+S2EzxY/Jci iLZYUsZKK1fIKyq4G/W9vSRsNV9PeSFHERdEqbKDR6NJsF7njpSZl/btzs3h3Qu4AbZO eHaQsxyvzHglQLNCpPksr69v919XUW0WIpysQBZT3XTJeONCqJRBnN92gV67Q2RvlOT9 p+FQ== X-Gm-Message-State: AOPr4FUVCwEmlS5QgGUuJbOZK8kgdhzJmyMtIEw7XR1477qk0IpCIys9vIZPguNgKux8Vg== X-Received: by 10.129.154.82 with SMTP id r79mr7225162ywg.85.1463120086636; Thu, 12 May 2016 23:14:46 -0700 (PDT) Received: from auriga.local ([201.230.133.32]) by smtp.gmail.com with ESMTPSA id l186sm9543089ywe.29.2016.05.12.23.14.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 May 2016 23:14:45 -0700 (PDT) From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice Date: Fri, 13 May 2016 01:14:36 -0500 Message-Id: <1463120076-9253-1-git-send-email-nhaehnle@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Cc: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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: Nicolai Hähnle Previously, (*device)->businfo.pci would end up misaligned, which results in undefined behavior. Signed-off-by: Nicolai Hähnle Reviewed-by: Emil Velikov --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 5f587d9..94efc08 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3000,7 +3000,7 @@ static int drmProcessPciDevice(drmDevicePtr *device, const char *d_name, const char *node, int node_type, int maj, int min, bool fetch_deviceinfo) { - const int max_node_str = drmGetMaxNodeName(); + const int max_node_str = ALIGN(drmGetMaxNodeName(), sizeof(void *)); int ret, i; char *addr;