All of lore.kernel.org
 help / color / mirror / Atom feed
* ubi: some invalid code in the function scan_peb
@ 2023-10-18  5:59 Ryder Wang
  2023-10-18  6:31 ` Zhihao Cheng
  0 siblings, 1 reply; 6+ messages in thread
From: Ryder Wang @ 2023-10-18  5:59 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org

I just find some dead code in the function scan_peb in drvier/mtd/ubi/attach.c.

In the function scan_peb, it calls validate_ec_hdr which calls validate_ec_hdr. If ubi version or erase count is incorrect, it will report -EINVAL and abort the function scan_peb. However, ubi version or erase count will be checked again in scan_peb and such check code will never find the errors because such errors should have been detected by validate_ec_hdr (aborting).

Thanks,
Ryder
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-29 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18  5:59 ubi: some invalid code in the function scan_peb Ryder Wang
2023-10-18  6:31 ` Zhihao Cheng
2023-10-18  7:28   ` Ryder Wang
2023-10-18  7:42     ` Zhihao Cheng
     [not found]     ` <MEYP282MB3164987D45E3CFC61B3E7CECBFD02@MEYP282MB3164.AUSP282.PROD.OUTLOOK.COM>
2024-06-29 11:22       ` ubifs: why ubifs doesn't support 2 copied of super blocks for better fs reliability Zhihao Cheng
2024-06-29 13:56         ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.