From patchwork Thu Apr 12 15:23:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10338843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5184D604D4 for ; Thu, 12 Apr 2018 15:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45A1327CEE for ; Thu, 12 Apr 2018 15:24:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39DCC27EE2; Thu, 12 Apr 2018 15:24:25 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0BD027CEE for ; Thu, 12 Apr 2018 15:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753738AbeDLPYX (ORCPT ); Thu, 12 Apr 2018 11:24:23 -0400 Received: from osg.samsung.com ([64.30.133.232]:35236 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbeDLPYW (ORCPT ); Thu, 12 Apr 2018 11:24:22 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id B6E501CF82; Thu, 12 Apr 2018 08:24:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mpX2QXrLDkqS; Thu, 12 Apr 2018 08:24:20 -0700 (PDT) Received: from smtp.s-opensource.com (unknown [179.179.40.138]) by osg.samsung.com (Postfix) with ESMTPSA id 4B49E1CF3D; Thu, 12 Apr 2018 08:24:13 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1f6e55-0005S0-1r; Thu, 12 Apr 2018 11:24:11 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Alan Cox , Sakari Ailus , Greg Kroah-Hartman , Andy Shevchenko , Aishwarya Pant , Guru Das Srinagesh , Hans Verkuil , Julia Lawall , Dan Carpenter , devel@driverdev.osuosl.org Subject: [PATCH 04/17] media: staging: atomisp: fix string comparation logic Date: Thu, 12 Apr 2018 11:23:56 -0400 Message-Id: <78c5c0b0c408206ee964a99557baec5c56c3dd60.1523546545.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP it makes no sense to use strncmp() with a size with is bigger than the string we're comparing with. Fix those warnings: drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c:776 atomisp_open() error: strncmp() '"ATOMISP ISP ACC"' too small (16 vs 32) drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c:913 atomisp_release() error: strncmp() '"ATOMISP ISP ACC"' too small (16 vs 32) drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c:2751 atomisp_vidioc_default() error: strncmp() '"ATOMISP ISP ACC"' too small (16 vs 32) Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c | 6 ++---- drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c index 709137f25700..693b905547e4 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c @@ -773,8 +773,7 @@ static int atomisp_open(struct file *file) rt_mutex_lock(&isp->mutex); - acc_node = !strncmp(vdev->name, "ATOMISP ISP ACC", - sizeof(vdev->name)); + acc_node = !strcmp(vdev->name, "ATOMISP ISP ACC"); if (acc_node) { acc_pipe = atomisp_to_acc_pipe(vdev); asd = acc_pipe->asd; @@ -910,8 +909,7 @@ static int atomisp_release(struct file *file) rt_mutex_lock(&isp->mutex); dev_dbg(isp->dev, "release device %s\n", vdev->name); - acc_node = !strncmp(vdev->name, "ATOMISP ISP ACC", - sizeof(vdev->name)); + acc_node = !strcmp(vdev->name, "ATOMISP ISP ACC"); if (acc_node) { acc_pipe = atomisp_to_acc_pipe(vdev); asd = acc_pipe->asd; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c index 6e7231243891..8c67aea67b6b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c @@ -2748,8 +2748,7 @@ static long atomisp_vidioc_default(struct file *file, void *fh, bool acc_node; int err; - acc_node = !strncmp(vdev->name, "ATOMISP ISP ACC", - sizeof(vdev->name)); + acc_node = !strcmp(vdev->name, "ATOMISP ISP ACC"); if (acc_node) asd = atomisp_to_acc_pipe(vdev)->asd; else