From patchwork Tue Apr 9 16:59:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitor Soares X-Patchwork-Id: 10891771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53D2A17E6 for ; Tue, 9 Apr 2019 17:00:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 346E4286FD for ; Tue, 9 Apr 2019 17:00:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28D492891B; Tue, 9 Apr 2019 17:00:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C281D286FD for ; Tue, 9 Apr 2019 17:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=1dv4MRRkzcoG53ENNtJuAOw+Px495cEOSSuSUqcvWsA=; b=WZV fwcQpZIjY/GhoV3OzriR6pjdcSVZuHqzYCJJ2nykqN4jf46cOPUribVsWKU+1gJ9kUuvIJXqWSxcu jnQ9f8Y9uz7D5JN2Ivt7hEWL9+6HY9aUeTtPspGThR+6pcAceLzEUolqNG6YbhRa9O9h2/zZuqZqz x1H9KP6J5ZHxUowpEVGu0S3RnMYGYAxUR1van2qDJ1i+ji/qDRz8mcckLNq/cXC50FQzK/nr+WXbi Y7xuJ5Xw3nrsymB878viOdbabuzCTrJQiznxy2h8Ud67DclxQObkG/0i4ITkwCl5ZloxhsJbqv1ml KyexLipktN9/0IcoRi/ShHtsNAURtHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDu6w-00021k-CU; Tue, 09 Apr 2019 17:00:38 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDu6s-00021B-S2 for linux-i3c@lists.infradead.org; Tue, 09 Apr 2019 17:00:36 +0000 Received: from mailhost1.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id E570510C19F9; Tue, 9 Apr 2019 10:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1554829233; bh=qYW9CR74s75k1p6PigaJRinaO/YYqxa9TonXg7nrbVQ=; h=From:To:Cc:Subject:Date:From; b=UbVGvjYGT54ru+ycB7TJtAsNih8DC3A+UM5vF2I4pY+GXdO2polf5Hbh3oI9YWFWc HTB43I4WCuLe1TQadEUV/E6NebAEFh6KQ0vpmP60Q7cD0jQGweq4xmjRGC8dAR0iTS F3H+ej1L8GvXbVFzRZZ/Mi1ZJ3MGHshpGsDV35aCs4zs1BV3kIgHxEb2BNukNZZMRC c8jS4vYkoSDoNnwQ1ExRF0Ajf5JyeRh2IXWTMVBJtDqrBxjJPSCjKE/w72zSfldRw0 uQSQr5uAXBP4VbgUaM5///l+zCVWDxeFm/tDLAhAWWFsMUGolP2juSkderJyl/7+p4 t8PzGGV2jnM8w== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost1.synopsys.com (Postfix) with ESMTP id 9CE035311; Tue, 9 Apr 2019 10:00:02 -0700 (PDT) From: Vitor Soares To: linux-i3c@lists.infradead.org Subject: [PATCH] i3c: Fix the verification of random PID Date: Tue, 9 Apr 2019 18:59:59 +0200 Message-Id: X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_100034_909877_70CF092A X-CRM114-Status: UNSURE ( 7.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux I3C List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: joao.pinto@synopsys.com, Boris Brezillon , stable@vger.kernel.org, Vitor Soares MIME-Version: 1.0 Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The validation of random PID should be done by checking the boardinfo->pid instead of info.pid which is empty. Doing the change the info struture declaration is no longer necessary. Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Signed-off-by: Vitor Soares Cc: Boris Brezillon Cc: --- drivers/i3c/master.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 569ea68..d23a57e 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2006,7 +2006,6 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master, { struct i3c_dev_boardinfo *boardinfo; struct device *dev = &master->dev; - struct i3c_device_info info = { }; enum i3c_addr_slot_status addrstatus; u32 init_dyn_addr = 0; @@ -2038,8 +2037,8 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master, boardinfo->pid = ((u64)reg[1] << 32) | reg[2]; - if ((info.pid & GENMASK_ULL(63, 48)) || - I3C_PID_RND_LOWER_32BITS(info.pid)) + if ((boardinfo->pid & GENMASK_ULL(63, 48)) || + I3C_PID_RND_LOWER_32BITS(boardinfo->pid)) return -EINVAL; boardinfo->init_dyn_addr = init_dyn_addr;