lkml.org 
[lkml]   [2020]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] fat: add a check to fat_add_new_entries
Date
trix@redhat.com writes:

> start_blknr = blknr = fat_clus_to_blknr(sbi, cluster[i]);
> last_blknr = start_blknr + sbi->sec_per_clus;
> +
> + /* overflow */
> + if (unlikely(last_blknr <= start_blknr)) {
> + err = -ENOMEM;
> + goto error_nomem;
> + }
> +

The cluster is 28bits and sec_per_clus is 8bits, so this should never
overflow actually. Is there no way to tell it to clang?

Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

\
 
 \ /
  Last update: 2020-06-21 19:57    [W:0.049 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site