staging: exfat: issue with FFS_MEDIAERR error return assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux