Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp546872ybf; Fri, 28 Feb 2020 03:07:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxWaZMGfqj/sShDCtVjD5I9HHmqR8v93wTeBXswFLvGvXx41EihO1inaxIjTIefDE0eCL9O X-Received: by 2002:aca:dc8b:: with SMTP id t133mr2748301oig.98.1582888053540; Fri, 28 Feb 2020 03:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582888053; cv=none; d=google.com; s=arc-20160816; b=fPUJeS2AxhqyP4HiBRkh1KgPq8ycpcXrOfvUj6c2c30qrEw36or91+HiRVfrm+M+Yq f3hps0BU3j16FxkjATL+hyTgIn9PvDTWyEPYoDDjJSibiClp/QLRk1Cf8ueA8vWcoOQ2 YgHuXCAKKCTrAYPYSMg1+Z2+P3c1WAWLF7dTaX1IOhwiWb6fqV1lOGCcQUff03Bjaak6 eANMGkpSmFPuaCXXEF1k0v7DpfSqOyO1n4ML4bsAUUznX271oFzgF8RlcGrU9kloN4i6 bAAhKxuLBmt93BqJ1JRB9vf2GnUzcx4OR4Z1z7lyevgViKfbuXwP7GRZuO4WF4JYH8D+ U3eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=6ZttMXpzkKUkjq7swchhjpIOghz2F5MHQ3V90TIxyaQ=; b=WzRpOkT1UhNbpYNn2kc78+KHoNQYqFjY91IXk9eLDBbR6TSjN/SKO3ZCqvVuUhl4I9 ZjwA7DRJDxPfD7J14cLhMZWYDacTrN2yR0F28hm/n4/GSDobB8p78hGSFlUYdahlaN1w 4ImaInTtgUPTII8bkkre78lh8tT57Xda48SBIjh2TBmWHBTD8gXNR9EIMoC0M55Alho+ +3gHnYriI4be5/IksJ/y36ATrmSLY5OGsAWdO5nU+cUwvPjZTAyLWiL7tybO6LA/7Lx3 1tEJIapUTriyM6CQpbDxpBXwzs27YmnKLbp7dsFKaRQ3FeOxYE+3e+HlNJoSUHyUY6eT WL6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@maquefel.me header.s=mail header.b=SLMoxyyB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x84si1799300oia.27.2020.02.28.03.07.21; Fri, 28 Feb 2020 03:07:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@maquefel.me header.s=mail header.b=SLMoxyyB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726860AbgB1LHK (ORCPT + 99 others); Fri, 28 Feb 2020 06:07:10 -0500 Received: from forward101p.mail.yandex.net ([77.88.28.101]:46378 "EHLO forward101p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbgB1LHK (ORCPT ); Fri, 28 Feb 2020 06:07:10 -0500 Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward101p.mail.yandex.net (Yandex) with ESMTP id D97A73281116; Fri, 28 Feb 2020 14:07:06 +0300 (MSK) Received: from mxback9q.mail.yandex.net (mxback9q.mail.yandex.net [IPv6:2a02:6b8:c0e:6b:0:640:b813:52e4]) by forward100q.mail.yandex.net (Yandex) with ESMTP id D719A7080009; Fri, 28 Feb 2020 14:07:06 +0300 (MSK) Received: from vla1-61ce7aa04735.qloud-c.yandex.net (vla1-61ce7aa04735.qloud-c.yandex.net [2a02:6b8:c0d:3e86:0:640:61ce:7aa0]) by mxback9q.mail.yandex.net (mxback/Yandex) with ESMTP id hroNpCvPZS-76FGlZsk; Fri, 28 Feb 2020 14:07:06 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1582888026; bh=6ZttMXpzkKUkjq7swchhjpIOghz2F5MHQ3V90TIxyaQ=; h=Subject:To:From:Cc:Date:Message-Id; b=SLMoxyyBKbppGva2H1uPKFfEtfRMT9Hvem6U0fMqdOPxpsfVWbcY4PClFQHmO1dBl 1R5vBbFSPMvP/3XbvwnQXVHqlioZ9j2axyxqPe/i5jqAJMT7cTcBhznj/gATBl8NZM EPslYk56AhFKSaKpr6zVt/6sJHtA2ZEjqTbeTkEo= Authentication-Results: mxback9q.mail.yandex.net; dkim=pass header.i=@maquefel.me Received: by vla1-61ce7aa04735.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id bXDf96qZCu-75IiPKaY; Fri, 28 Feb 2020 14:07:05 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: nikita.shubin@maquefel.me Cc: nikita.shubin@maquefel.me, Nikita Shubin , Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: error on kick missing Date: Fri, 28 Feb 2020 14:08:04 +0300 Message-Id: <20200228110804.25822-1-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikita Shubin .kick method not set in rproc_ops will result in: 8<--- cut here --- Unable to handle kernel NULL pointer dereference in rproc_virtio_notify, after firmware loading. refuse to register an rproc-induced virtio device if no kick method was defined for rproc. Signed-off-by: Nikita Shubin --- drivers/remoteproc/remoteproc_virtio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index 8c07cb2ca8ba..31a62a0b470e 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -334,6 +334,13 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id) struct rproc_mem_entry *mem; int ret; + if (rproc->ops->kick == NULL) { + ret = -EINVAL; + dev_err(dev, ".kick method not defined for %s", + rproc->name); + goto out; + } + /* Try to find dedicated vdev buffer carveout */ mem = rproc_find_carveout_by_name(rproc, "vdev%dbuffer", rvdev->index); if (mem) { -- 2.24.1