From nobody Fri Apr 28 20:04:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q7NqX6XJHz47v4G; Fri, 28 Apr 2023 20:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q7NqX633Wz3JmW; Fri, 28 Apr 2023 20:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682712280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jSogZDgMZTZChV9xstZFCAQA1sGhSafTligenQCoBZ0=; b=NQL5WYFBtgKi2oatYin4CHMKrl5wYMYzIC0VBxIazRx02P3GXLybDSS39Q73aIgQzhdrUq hA+gGLQSGi+cmhzAhXbtd9mmrL30bNPyYvR1j/FV5guSpMMDjrDksL3jrFFCZCUCWV0f1v C2AS9V46L9nKMBVivEgVkZ6n58XkoOFlcIcxgxTxI2EeAsJo/ErOpmVLfuokjerq92hTt3 FWZGf/CXh4Z5EEYOwR6ERhV0IWlqYe2rzxPO9FbMJQKpd54aWFoylsjWY0PL60cl98MUdI BNWOMC8B+metU4jS0/d0yFnT2ZhJYC+clrO5Ra/x8rdJ2eMILVMn3EQ1GCnTtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682712280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jSogZDgMZTZChV9xstZFCAQA1sGhSafTligenQCoBZ0=; b=i4qrQaINfDpI7Xz0a172Pif6exDmhjAWPG5lSLvkg7YobEAZxzTlKMNprEjXwC5x6EJsFa 8/dr/O/MwNw0FkvZDNC7pU1mdr7/DWbKROh6RMRmuRILVivOXOwjik2qv7U4hhiU8RKmFT zQqpwZ9eQDvFGEXRJowgHizsgu6z7cbzd5Erv10sTmzgGdt4VySL+C5BPxAeck2w5qmOTx UuDrw0OlIOTvEHTajZ8tcZWBFPolbgHWSpiGjcwPIMqK5fXjEv19+kklohyHXHBKce5GYf vR90EvPmLA+67An8cyE+rcKgWcwXK88BWkD2xYXoXaG4DNnMgmizP3knsnHV6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682712280; a=rsa-sha256; cv=none; b=JUt9JW5oNknUyAwohs8zgCUJde3qzs/ToP4Jj/BX6NFqZGbDO1NMpW89j7URWLIX6PLa0E gKx4+FjkAXpm+z4Gfv60qkdujYXmovpNfqk4AYUUJ277UvQ8i6KAh4/Lfv74SviAnY6RAS RhiCx1P3AQXbcfyf7JzXg+VjPr5N9NKKwWVJU5rx1oE/X4byzE6rHGbfnsB+NKHWDBWmkF TDigYgG7dAOglY8LfAwYx1FrtOhmxS9cpJD/UStKcS91FYxGXgMcGwFelzuSC+/3xzMi3Q iA7uQWcQdoccHI2mFXAxccdp3MrMFg85QjTEpSukhlW4PmfOa2BmZsnlvhRBGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q7NqX55S4z1CN4; Fri, 28 Apr 2023 20:04:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33SK4eem025161; Fri, 28 Apr 2023 20:04:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33SK4eq7025160; Fri, 28 Apr 2023 20:04:40 GMT (envelope-from git) Date: Fri, 28 Apr 2023 20:04:40 GMT Message-Id: <202304282004.33SK4eq7025160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d43bf55fc545 - main - armv7: Fix BeagleBone Black panic on system start List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d43bf55fc5457dd0b95f19ebbffcc8d8501ea157 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d43bf55fc5457dd0b95f19ebbffcc8d8501ea157 commit d43bf55fc5457dd0b95f19ebbffcc8d8501ea157 Author: Konrad Sewiłło-Jopek AuthorDate: 2023-04-28 20:03:38 +0000 Commit: Emmanuel Vadot CommitDate: 2023-04-28 20:03:57 +0000 armv7: Fix BeagleBone Black panic on system start There is now assertion which requires all memory allocations of positive size. Negative and zero-sized allocations lead to panic, so plug them off. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D39846 --- sys/arm/ti/ti_sysc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm/ti/ti_sysc.c b/sys/arm/ti/ti_sysc.c index 2f6011e3049d..603dec3334c2 100644 --- a/sys/arm/ti/ti_sysc.c +++ b/sys/arm/ti/ti_sysc.c @@ -306,6 +306,9 @@ parse_regfields(struct ti_sysc_softc *sc) { /* Grab the content of reg properties */ nreg = OF_getproplen(node, "reg"); + if (nreg <= 0) + return (ENXIO); + reg = malloc(nreg, M_DEVBUF, M_WAITOK); OF_getencprop(node, "reg", reg, nreg);