Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1392661ybv; Thu, 6 Feb 2020 03:17:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwV7mXtfYlt/IFUVALJj9JmgBhDHoESWApG5fvGRn+UnpRU3N+vUjTvfp1yaZ4mW4HoZWkW X-Received: by 2002:a05:6830:2154:: with SMTP id r20mr30812467otd.131.1580987867049; Thu, 06 Feb 2020 03:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580987867; cv=none; d=google.com; s=arc-20160816; b=FxM5ilo7PpbSTW33kBrML6uaeOV3sdFiDYOYVEBVB1djbm2odKubXrijOIuthrnTim J6MWI1bT+pE2l6hK/5xlWCpnq4wBH7z1/ssS/Ks91TqFaxwsauj9Of3cLsWpHalz+XEr Zgn0VXrMFaFOpL/F3vMeu+Dp5VY4iLoKqEn+0Kf2/1AvEreG9tDmhzDTsijEtYKbWUw9 eRulXNHskH1WgepEWNWJg6/XellLka4ynzDu9XVSj42+oTOusN+PGGWUmQCkPAIJGQVA O5vWbX5RuQUg2jhTmIf6JU5g049SUchTcmjs93RjTKoAMIKXpGDk2hvedxss1Zql/er/ cwFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id:date :mime-version:subject:references:in-reply-to:cc:to:from :dkim-signature; bh=fuTBuOzRnyOKXn5u3YXXAdgvmURkN9prmY9Qet2z66U=; b=NNFw0WBx/+elJUqmhsxOStta0LcuINXMitOr2DKoSwjp3SWl17WMKdJE/yF8RH8SJ7 oh+6R4B4evZxnYvdJ5r55U0MAuK6k5lRC3RCb9kJ7M6PHEsaa7CeiRZtDUJDkSmll1ii zl2Vct4Nn7JkHSNQZAyYN4bnAihQtCjhL/mp8jAcw3IPbXv8MhPmR0NbaU6o8SGY4wNP wk1kS9FWUWheOnGDwHIM8llyru/KfyDyusksWwjUQRJb4vWqrYmjBqp2yYSKVlxtt3Qm c5g/YK9GQJNKUhI7zj70ievlJa4yLq8GiLZTLUHCdjk8ftINIxSSqEWLUaWxK3p2s9VL dLoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maquefel.me header.s=mail header.b=mtMC4iVi; 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 n20si1816322oig.53.2020.02.06.03.17.35; Thu, 06 Feb 2020 03:17:47 -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=pass header.i=@maquefel.me header.s=mail header.b=mtMC4iVi; 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 S1728036AbgBFKpe (ORCPT + 99 others); Thu, 6 Feb 2020 05:45:34 -0500 Received: from forward500j.mail.yandex.net ([5.45.198.250]:40757 "EHLO forward500j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgBFKpe (ORCPT ); Thu, 6 Feb 2020 05:45:34 -0500 X-Greylist: delayed 311 seconds by postgrey-1.27 at vger.kernel.org; Thu, 06 Feb 2020 05:45:32 EST Received: from mxback24g.mail.yandex.net (mxback24g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:324]) by forward500j.mail.yandex.net (Yandex) with ESMTP id D3DA411C257D; Thu, 6 Feb 2020 13:40:19 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback24g.mail.yandex.net (mxback/Yandex) with ESMTP id 86NWYwlhNY-eIZ8qZp7; Thu, 06 Feb 2020 13:40:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1580985619; bh=fuTBuOzRnyOKXn5u3YXXAdgvmURkN9prmY9Qet2z66U=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=mtMC4iVioaUvWtg0KO5P1FHI7HJDqCh/aOrmImQ6wPdVuzDidX0NjHClbZFaaalEz eBNuqUTWKvy2SJTxi6w7i7sZFS/aTKYF0zKRNcUyTdGlaYJnod1YWg0VqVXGD5pcgp r41pH18l4xnqKQB8pEnjTXbJ0L0t8tpJUKhhe+lo= Authentication-Results: mxback24g.mail.yandex.net; dkim=pass header.i=@maquefel.me Received: by sas2-1c82b59a1818.qloud-c.yandex.net with HTTP; Thu, 06 Feb 2020 13:40:18 +0300 From: nikita.shubin@maquefel.me To: Nikita Shubin Cc: Ohad Ben-Cohen , Bjorn Andersson , "linux-remoteproc@vger.kernel.org" , "linux-kernel@vger.kernel.org" In-Reply-To: <20200206055419.15897-1-NShubin@topcon.com> References: <20200206055419.15897-1-NShubin@topcon.com> Subject: Re: [PATCH] remoteproc: warn on kick missing MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 06 Feb 2020 13:40:18 +0300 Message-Id: <25402731580985618@sas2-1c82b59a1818.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for malformed message, please ignore it. 06.02.2020, 08:53, "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. > > At least a warning needed on attempt to call missing method. > > Signed-off-by: Nikita Shubin > --- >  drivers/remoteproc/remoteproc_virtio.c | 6 ++++++ >  1 file changed, 6 insertions(+) > > diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c > index 8c07cb2ca8ba..77a81f331e3f 100644 > --- a/drivers/remoteproc/remoteproc_virtio.c > +++ b/drivers/remoteproc/remoteproc_virtio.c > @@ -32,6 +32,12 @@ static bool rproc_virtio_notify(struct virtqueue *vq) > >         dev_dbg(&rproc->dev, "kicking vq index: %d\n", notifyid); > > + if (unlikely(rproc->ops->kick == NULL)) { > + WARN_ONCE(rproc->ops->kick == NULL, ".kick method not defined for %s", > + rproc->name); > + return false; > + } > + >         rproc->ops->kick(rproc, notifyid); >         return true; >  } > -- > 2.24.1 > > Confidentiality Notice: This message (including attachments) is a private communication solely for use of the intended recipient(s). If you are not the intended recipient(s) or believe you received this message in error, notify the sender immediately and then delete this message. Any other use, retention, dissemination or copying is prohibited and may be a violation of law, including the Electronic Communication Privacy Act of 1986. ­­