In the Linux kernel, the following vulnerability has been resolved:
can: mcan: mcanreadfifo: fix memory leak in error branch
In mcanreadfifo(), if the second call to mcanfiforead() fails, the function jump to the outfail label and returns without calling mcanreceiveskb(). This means that the skb previously allocated by alloccanskb() is not freed. In other terms, this is a memory leak.
This patch adds a goto label to destroy the skb if an error occurs.
Issue was found with GCC -fanalyzer, please follow the link below for details.