From nobody Tue Feb 10 02:27:37 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1604682836; cv=none; d=zohomail.com; s=zohoarc; b=SqW4kiZx4jVNqWmckAfSSDzHuxM8Y2bzrRFPfCyRqXfBpz+heMbRbWhsbFkNVvvpeUz3AocJxSZXo3RavLf/eU8k1GUew/oA7Crm252Um76R0ArmncWDfLXkYmPnU6GHXTR9bZa1GHkx36EGL3VOKhc1BhphJ0hcq+Okzn8Tr4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604682836; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nE1i2hAAqaIuOFEo+8UFV1Ok6/fO1ASvmRXI23HSnQQ=; b=S8CopOFZS0yuM1tMnOh+1tXgCBMdqLRFY0+APy2H3oKPRm5wFPxc4/0sWrDRNXp0uFB3dEVV28iXRpf19FPq4Rxxy5utVQX9DQSftFA5JGNvVQzIwW6Kf8KkKa5Z8YyQrivV5dEXlZAlAj0c1dFt8eo2DWFUnobsHaebZd9YuLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604682836353781.9999864580822; Fri, 6 Nov 2020 09:13:56 -0800 (PST) Received: from localhost ([::1]:40692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb5JC-000358-8M for importer@patchew.org; Fri, 06 Nov 2020 12:13:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb5HV-0001I6-Fe for qemu-devel@nongnu.org; Fri, 06 Nov 2020 12:12:10 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:40736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kb5HP-0003NF-2a for qemu-devel@nongnu.org; Fri, 06 Nov 2020 12:12:09 -0500 Received: by mail-wm1-x341.google.com with SMTP id k18so1998151wmj.5 for ; Fri, 06 Nov 2020 09:12:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id l1sm3162649wrb.1.2020.11.06.09.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 09:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nE1i2hAAqaIuOFEo+8UFV1Ok6/fO1ASvmRXI23HSnQQ=; b=qgo/+5ERyCclTWErEzcmtlr813OxzasDLZPv3kGPFB+AWSaQI//UjJxi5Q7MMI05dp HJAcF4xqKYnOmIW5WiuFpEAU6xFrKiwGglz2u2NhxnyxqwdNYKSbaPDyfo5BGBY5iF/J LVsPAni/KdliaS8UL36MOl0GpiMTydgz34e/UUjzhDs0gaYGYMrdLzMYUoxFAp6For31 zbzjnlD7wjBH9JWOZ4794W34ZFs66XRdAAI76fUfhMKdIGFGmxeSHa9GvkZjJPdn/ZmO Dp5qX84GQcCMM54qMk8tkOZe3i7dpPnZPmL7lA9YVsOgwc5fZxqYNSMNMOWrJuyPQNzv dj4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nE1i2hAAqaIuOFEo+8UFV1Ok6/fO1ASvmRXI23HSnQQ=; b=NhwX4bfbqWm/nNRLU+Eswx5a+TvVaQco9RNyHibRvCGQKZWO9UL1RD2tpGwHRxkEkE eEv3y4SVWdAWbxyBjSdCoYiNdRJ1GApArv2Tx65HePq6/lWGGzU0uR90T9SIjr4Xi3w9 ZVxgZra+NMKsaKDkmP41DvSh9oErmeKB619/cENcS8e4dzHHTvQNS1cM+mhftF22ZkM9 oPYZhEG7odpQAzEtrvbwq/WZH7JvKjmAJ1XjmnN9ivyYkSuI7ghijHGmI0gGtQ91ZKZA u/XAFvO1dC8tVmx+9WUgZAEH+w4d0dvudYdUAanGlHFPTRctw2av59t9qsw1TRWtzgn7 ODgg== X-Gm-Message-State: AOAM531/vXqiKZMQoFxC1HXZiFmiPbkM2n7I3/YWNNR2xtmEs8m/9Hg5 +miSCtTiLyAebb/meoB/FNZk8seo4J43AA== X-Google-Smtp-Source: ABdhPJwE7UbCW3ZL5xhezAlpe5z3+Kb5RRqpkxzitOCO1y9e4AdNpt71q2wKpSDOCsbMItbxEHAexA== X-Received: by 2002:a1c:b487:: with SMTP id d129mr672541wmf.38.1604682721478; Fri, 06 Nov 2020 09:12:01 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH for-5.2 4/4] hw/net/ctucan_core: Use stl_le_p to write to tx_buffers Date: Fri, 6 Nov 2020 17:11:53 +0000 Message-Id: <20201106171153.32673-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201106171153.32673-1-peter.maydell@linaro.org> References: <20201106171153.32673-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Vikram Garhwal , Pavel Pisa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Instead of casting an address within a uint8_t array to a uint32_t*, use stl_le_p(). This handles possibly misaligned addresses which would otherwise crash on some hosts. Signed-off-by: Peter Maydell Acked-by: Pavel Pisa Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/can/ctucan_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/net/can/ctucan_core.c b/hw/net/can/ctucan_core.c index f2ce978e5ec..e66526efa83 100644 --- a/hw/net/can/ctucan_core.c +++ b/hw/net/can/ctucan_core.c @@ -305,8 +305,7 @@ void ctucan_mem_write(CtuCanCoreState *s, hwaddr addr, = uint64_t val, addr %=3D CTUCAN_CORE_TXBUFF_SPAN; assert(buff_num < CTUCAN_CORE_TXBUF_NUM); if (addr < sizeof(s->tx_buffer[buff_num].data)) { - uint32_t *bufp =3D (uint32_t *)(s->tx_buffer[buff_num].data + = addr); - *bufp =3D cpu_to_le32(val); + stl_le_p(s->tx_buffer[buff_num].data + addr, val); } } else { switch (addr & ~3) { --=20 2.20.1