Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp450924imm; Sat, 26 May 2018 03:25:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp9lj/gX9TOmPLGyZnaybg2I7/J5kKD5r1Kt6v4MNnh7F+ynSxKgGABrU+WEA9qUsOMhh4T X-Received: by 2002:a63:9843:: with SMTP id l3-v6mr4736128pgo.208.1527330343488; Sat, 26 May 2018 03:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527330343; cv=none; d=google.com; s=arc-20160816; b=u/ELyG446URlZBB66Rm+aME+iCkwRXxdD0JQPm0OtW1JrWl1T6/zS3OlzB0ZxoAASF OqPYsEJ5zWxZnTK5r9hPiPQ+OXw1s3MyydCapVdEguhGHvzKnqAUY+WK4gg+BbUsK9qs NEOqMIirRHkL7Qg0AXVWHBOnkl8LY8xIq0bM4Y2Y6E7GHb0ocm6k0M6Ut7ku1wy4OEfi i8bhRL7id9ARnDxrySKis8A7r+Hfo411hRrnvDT+VxcoZFMhuImGnuRktqf6jzNXkxiS SHILOOf8ttfBp14HvX94AJiGJvqUMcRSmKwAoRoJCKS1slGxZlYeFBn8VwfFl2YqCJZi AnSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6p5mGYD4Q9alNjIeOwcagB2UK367cWqPVtBgNF19Q2E=; b=kSZxbxSY7W6me9A9T/FAWMYpgNepvOpq6ciCen5+nXHc9WmEoXyJlMyhzbT1rhoTOF YRe2wuZP/xgaRRHJfZmb6HETYGcnDpnm3PpwDBP2ttnkwTpg7Cz11waAfLc1VnDLWx8L dF8rObVUUIsrs4/7A7BcupfpYldwDQlve2dILyMMoagBsw11aaxrPjJv1lLJRbGOZMoo t5RIWkk4LaD9SeHidp0mTD3Oz4sTbzLb7cI+pcC5dhhAvruuXXGcUTYzT4nwNwWzVVY4 YSD1kEOia7xxw+b2g0yVZwa6zaAq28VF9FrNuyAThWJnwAlPn3vSZmoyLZaNdTLjMQz5 1N0A== ARC-Authentication-Results: i=1; mx.google.com; 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 h21-v6si744309pgn.279.2018.05.26.03.25.16; Sat, 26 May 2018 03:25:43 -0700 (PDT) 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; 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 S1031694AbeEZKZI (ORCPT + 99 others); Sat, 26 May 2018 06:25:08 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:58747 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031615AbeEZKZH (ORCPT ); Sat, 26 May 2018 06:25:07 -0400 Received: from localhost.localdomain ([37.4.249.138]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MHehs-1fLQRg2LFc-003Mu9; Sat, 26 May 2018 12:24:40 +0200 From: Stefan Wahren To: Jassi Brar , Eric Anholt Cc: Florian Fainelli , Ray Jui , Scott Branden , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH] mailbox: bcm2835: Fix of_xlate return value Date: Sat, 26 May 2018 12:24:00 +0200 Message-Id: <1527330240-6181-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K1:qXsp9dKLa81BswkD3cgAfgRVR3VR4YxrXLJBlCE8RZSSAG9uRTJ aodYgLFgqGc6YYepljhH2651S8XWU2JkZPMtL+H7TGoXXFinAQqnHMUyCiXwGKMvhNozGFO Z4Rd9BY1yu9THkNhpeOJ0fWwJNPZgWQaWMr7R0T4JNXK9hEMyLJ0sRiSTwSzrb+J44YIOXm go5QhJ/u/bg40gvopKtFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:77Rjb3R+PhU=:KTEdXo0MXpW8YlKcTcwsG0 PuMWl81vAEprWQIXS1JFn8K/R4nCCJ3Wi9bc6HoJmASqiqD8XDpBeYEBTUUNBeIIjeEFtfkEA 6l4dHlRN8rg19MRgAslYhKAkLL0zaJZgxOT23yKj2vTCQqv7hzZcIjjdqrNsh7fEpC8kf9yM9 Khz9cj+QwTIX0g7uCw22LdOrUy1eqqwJyriXxbo6v9kXQQM6VEnIDVVJ7dq8QYaOnNk44nezy P71uygR+kf8KaeqPo8O7w7G/qJg6o3iNygoy4I+xYZ2X5c7TbGS4K3gBUoiw8w3qO9t+5z+dd +zo9utP1CVJDGkwS+ncGMvmRvQGcjyzcd41bFFeZAHd7BlgI5bjRJGYiWDe5cOmGgpPAZ6Rwo wtq9VOhgbwg8igYe8riQ2ElbaKp+7ozi1P/R5UGvwuTYBIDQeuO8sQ3/okrNlshi/c3GMQ4Yd vNpZWEKqir6g+xSQXdyq8AM0e79hNu/u8/HLEtXgrVecB0Rnrjmm8W9y+CPReXKouQy9ojfqF fIysU0aBZHnNln9jgRhO2tid3tTXvLi9nqFrQuGXmxrDkCSEoXmDfxXr+tlFUHPgBJ+ETQNEJ APdNUK3psDVVl6bpykjAJ0eyxrULkAvLEA3fvtOZpm0DkOnm8S983NXW/AmfaN9ezqvChNIWR RcpIqWgHhQOIkDbD9VN+pBh7bumSlT6jsTHXSgGQw49Nss7+kjIAONe7oH55wfV4hobY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The bcm2835-mailbox returns NULL instead of an error pointer, which could result in a NULL ptr dereference in mbox_request_channel. So fix this by returning a proper error pointer. Signed-off-by: Stefan Wahren Fixes: 0bae6af6d704 ("mailbox: Enable BCM2835 mailbox support") --- drivers/mailbox/bcm2835-mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c index cfb4b44..e92bbc5 100644 --- a/drivers/mailbox/bcm2835-mailbox.c +++ b/drivers/mailbox/bcm2835-mailbox.c @@ -134,7 +134,7 @@ static struct mbox_chan *bcm2835_mbox_index_xlate(struct mbox_controller *mbox, const struct of_phandle_args *sp) { if (sp->args_count != 0) - return NULL; + return ERR_PTR(-EINVAL); return &mbox->chans[0]; } -- 2.7.4