Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp880240imu; Wed, 28 Nov 2018 00:43:56 -0800 (PST) X-Google-Smtp-Source: AJdET5f2UiIH3tUq/CN5WcvzMQAgp1DfPv+OebuKKlZ1pc23Xvxg9qsplc7GJ6aX187UKCwQMdnT X-Received: by 2002:a62:2292:: with SMTP id p18mr37501580pfj.9.1543394636050; Wed, 28 Nov 2018 00:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543394636; cv=none; d=google.com; s=arc-20160816; b=x8tPvjvTyQedjydsX35xlUHDN9aC0jlxGO0lrsNXctOAvS/9PjNFjHsobfK4d959d+ jYJ5Efq4sYIr0QbmZ0U297fzLpiAg45LPvbAtmwpM1mu0VhJvxFus7zS2qoG9H6u88DT UIPbuvV5AcncJ2sQ0GTnC6ZjKG7RBY8quhEH7JshHLZJyNS3DCw/SrSFuB4cDrehDDOf YU3VOCXhdhmiXYKs+6DDNoIjhUyWOv+YNkjUz8zwpSxR2wz/lrh+t3RRM6ah4umCOfkS UAMjH8dpNfFMJlopVEbXkW+QJpdUKXwNZqKqQ3pHrUwOTg14x1xsKycfCeVcrHxHeo3H q/QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=OCELMdJKg+ESCWK2WveeCs1j+dOk7bvy04zzovQJFPE=; b=S00Hfy2Au/hZRQ/anzpsPu8RAuQ5ZaN6olccHAuJ0V0ZxW5TWCv22PN++0jJJvfcDE IgKXpNcfMvMy7EDhh2nlg/ztbL0fkRnN3QiRK8tMz8MpZLJMFnlSLwGjh3oFQlaRQGaa lHBX+o9U7vljeufAxIjGTt7BYFETSn3PgOB1oEayv7LaX45iowzdfeXnXJdH82iTyF5N yIAQWTJf5Ws0u1YlIt393mL9oopxJkhxJm866ReNFm9qjF9vlF69x9/1yihsFTdUJ48V Y/SQtOQv6ZQon+7fbfDG6ZBTnHrTaf94fUISGChBbOlxmCVPZZ7A8dOqRQTPe4ApeMAd D/JQ== 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 s36si6738749pld.46.2018.11.28.00.43.40; Wed, 28 Nov 2018 00:43:56 -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; 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 S1727945AbeK1TmK (ORCPT + 99 others); Wed, 28 Nov 2018 14:42:10 -0500 Received: from mail-vk1-f194.google.com ([209.85.221.194]:37232 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727882AbeK1TmK (ORCPT ); Wed, 28 Nov 2018 14:42:10 -0500 Received: by mail-vk1-f194.google.com with SMTP id 197so5735910vkf.4 for ; Wed, 28 Nov 2018 00:41:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OCELMdJKg+ESCWK2WveeCs1j+dOk7bvy04zzovQJFPE=; b=ICIu8PLI/3md0z8sz780imdjbJvv4yJmw1zbUXToFfQfdU3DRQBnGGz0Fww69m5xMZ Y25W5n44Ydeznl9PK4hw/X+6vd/k5MrUsChsHDHvg+/UQYxfUj2T8F8LsmvO8n6ssDPt AjULilJiSr1sjkc2NawoHxzotY3s07v+oIYT0ARChutpRcRGQYkJHs+b1BcWhXmR7OGs hQbLdR6PlcDCtnQVgYl1urPVfpzIWZ1U3XV8Zh5s3CVtEqKCoIU+PIt24TNODlGH7aTG nWuVEgwGUrWCDOf7XUWyPGyMQS1JK0pc9bgIXHiOtDTob2EpALFZKTYJfwMH6k45y2lK ti/Q== X-Gm-Message-State: AA+aEWbbq20cWbKzaV4pITPdjvABegEAwRkFcsTNXmzZcDcU2QUGimaU 2kV3ZHS0DAZ2Q4hKMZoEf8UYQguaGZW7qkIe9qQ= X-Received: by 2002:a1f:2145:: with SMTP id h66mr14939751vkh.65.1543394479690; Wed, 28 Nov 2018 00:41:19 -0800 (PST) MIME-Version: 1.0 References: <1543392134-1443-1-git-send-email-huijin.park@samsung.com> In-Reply-To: <1543392134-1443-1-git-send-email-huijin.park@samsung.com> From: Geert Uytterhoeven Date: Wed, 28 Nov 2018 09:41:07 +0100 Message-ID: Subject: Re: [PATCH v3] mtd: spi-nor: cast to u64 to avoid uint overflows To: huijin.park@samsung.com Cc: Boris Brezillon , Marek Vasut , MTD Maling List , Linux Kernel Mailing List , bbanghj.park@gmail.com 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 On Wed, Nov 28, 2018 at 9:03 AM Huijin Park wrote: > From: "huijin.park" > > The "params->size" is defined as "u64". > And "info->sector_size" and "info->n_sectors" are defined as > unsigned int and u16. > Thus, u64 data might have strange data(loss data) if the result > overflows an unsigned int. > This patch casts "info->sector_size" to an u64. > > Signed-off-by: huijin.park Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds