Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3743849imm; Fri, 25 May 2018 10:48:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp3/mmZHF5sINgVtn7EPeFhKG7EIU4889tOLZNo7riYTXzmaVbtTNaVKHaUbGjnKQPmugt1 X-Received: by 2002:a62:5610:: with SMTP id k16-v6mr3514613pfb.19.1527270508810; Fri, 25 May 2018 10:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527270508; cv=none; d=google.com; s=arc-20160816; b=H3uLM2sJiBIUtgEfIeS/U8u7WB0O687p16molEEcF0UMrPJkFaX5Cpf/Rq7QrhU8i5 aQw/mOHQN8KLucZA3RG88b8agpP1ei+6ccileVyDMQPpBRN7TglqwdA3W+exQSY0lwZF 2WhmSCd+ZCDmeevDYoIUfFou0DQfX/c1laDn0N85hfQbu02XUIC8fldPytL5btgKtHwJ LSVHGpRBlgft7TSGaKKdoVCE17IC/v3I1nNfnpAcw7mCDc67UTy72GrhrTnjYzb7WarZ 8jTLh86TfFJvH5tbr9khbcQIYPfqZUFfxeG8Vs4w+N+hu+KUpTIe9pLy+XOKJPPwcbkY wCdg== 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 :dkim-signature:arc-authentication-results; bh=ZwUevtF2VLF2n6NjRQV/iYBJjrV4pzr1p8JJ430sprk=; b=GcUW3oxaF/FRvpeE4J9PHOfNr9OLvLlKVi9Erqc/SD9oCg5FXaFnp8e6YtBis2pRsc nF7qkj/BmsHuOkCDjHq/ixpPbKLsELa9Gf7NgsXo+YGVQetzoclJhcPORe3BF8ODkO22 rW3y9c0WrEwSbzqr8wNNQuQ2LK4vMQg97DNoP6DPQ+HmXxdoE4WYCMDQnVkXgyQL915Q vkENjrbZKttDtr0C3oNOCXOgFnZeST6HDzymiu1cS73WLOg1unjNez5UbStWHGohh4zg uBveqWW8DheTynQU2WT2Xr6FpRThf4vVwooIoAhtTgC5PR5TZgWXmOiev4LZUun9DU6R 0p/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dfWPV7So; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5-v6si24713287plo.479.2018.05.25.10.48.14; Fri, 25 May 2018 10:48:28 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dfWPV7So; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967547AbeEYRqz (ORCPT + 99 others); Fri, 25 May 2018 13:46:55 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:33401 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967490AbeEYRqu (ORCPT ); Fri, 25 May 2018 13:46:50 -0400 Received: by mail-wr0-f196.google.com with SMTP id a15-v6so10559677wrm.0; Fri, 25 May 2018 10:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZwUevtF2VLF2n6NjRQV/iYBJjrV4pzr1p8JJ430sprk=; b=dfWPV7SoHSN/LZE+Nc422120JlY5vWpro7YJGe049eMt5Lph9sKmsE5HqDe/hfRSEe fAUoSpMr6aQ+c9efycKuqwCqfIZSetpHKqtM3ocHINjmWZTkzg2cK/LZK8OCRgNVCBN/ hSyWRO9xPWR1YLsnhQh4p5l6toIAbrZa94LPZj1PZZLRSGh/8/EZNWqxtt94qjlYtHXr pVC9LPh/QNSJ2NSnR8KEOHjILHO8/4x7IkQ+tKLEQz3hjQLElU1Kz33aHvU1PhvkdY5w e8K8WbeDGjCFrP7qRoZOMwi9LwO/gLsR4QzVir/k3WGaAWnPzMW5C0/dsd2Z5Khsa6s9 KFhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZwUevtF2VLF2n6NjRQV/iYBJjrV4pzr1p8JJ430sprk=; b=uIUtXG44XPBCbReI6DODJBNEPeXt4PKzSBbP+LvdfldY0JKVsXQmvT+wcbPvHwwfdW EJ9ZF7Tk98Kws4wWNFXt4zqoEb9srb/ZS5jO3PItL4FhZdynLJaV5ADMpOvH+WDNbi6m /AXv0lqEnwCAGWtXpSeGha4nHZD7c6EMZMKG4PWU1EGVNvXaC+smo6sr4SKD/Y9CUiv/ A/RcDAvM6//mcHIRnAGbhYd0+DLaiyfVGWUQuI1rPuMBJrQCjUjrKBROOzeEaL+h3SYT nnbFwcKp42lvqU+gp2B6qUr3EhpE/OE+kdYSM97cHtEkzOMG3wER17zdGwK4lrirGc9y x96w== X-Gm-Message-State: ALKqPwfz3HHvxISVBsS+h2MLTyxtaYFh+65mgaRlAny+oolgVDW85ZQY ti/ocazgMuGEPlVQYrH5lQU= X-Received: by 2002:a19:3bc5:: with SMTP id d66-v6mr2013590lfl.113.1527270409531; Fri, 25 May 2018 10:46:49 -0700 (PDT) Received: from localhost.localdomain ([188.162.64.233]) by smtp.gmail.com with ESMTPSA id l24-v6sm4550824ljg.19.2018.05.25.10.46.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 10:46:48 -0700 (PDT) From: Ivan Bornyakov To: 3chas3@gmail.com Cc: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Bornyakov Subject: [PATCH] atm: zatm: fix memcmp casting Date: Fri, 25 May 2018 20:49:52 +0300 Message-Id: <20180525174952.21965-1-brnkv.i1@gmail.com> X-Mailer: git-send-email 2.16.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org memcmp() returns int, but eprom_try_esi() cast it to unsigned char. One can lose significant bits and get 0 from non-0 value returned by the memcmp(). Signed-off-by: Ivan Bornyakov --- drivers/atm/zatm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 9c9a22958717..a8d2eb0ceb8d 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c @@ -1151,8 +1151,8 @@ static void eprom_get_byte(struct zatm_dev *zatm_dev, unsigned char *byte, } -static unsigned char eprom_try_esi(struct atm_dev *dev, unsigned short cmd, - int offset, int swap) +static int eprom_try_esi(struct atm_dev *dev, unsigned short cmd, int offset, + int swap) { unsigned char buf[ZEPROM_SIZE]; struct zatm_dev *zatm_dev; -- 2.16.1