lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectstaging: exfat: issue with FFS_MEDIAERR error return assignment
Date
Hi,

Static analysis on exfat with Coverity has picked up an assignment of
FFS_MEDIAERR that gets over-written:


1750 if (is_dir) {
1751 if ((fid->dir.dir == p_fs->root_dir) &&
1752 (fid->entry == -1)) {
1753 if (p_fs->dev_ejected)

CID 85797 (#1 of 1): Unused value (UNUSED_VALUE)
Assigning value 1 to ret here, but that stored value is overwritten
before it can be used.

1754 ret = FFS_MEDIAERR;

value_overwrite: Overwriting previous write to ret with value 0.

1755 ret = FFS_SUCCESS;
1756 goto out;
1757 }
1758 }

I doubt that's intentional, should it be instead the following?

if (p_fs->dev_ejected)
ret = FFS_MEDIAERR;
else
ret = FFS_SUCCESS;
goto out;

Colin

\
 
 \ /
  Last update: 2019-08-30 20:38    [W:0.064 / U:8.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site