[PATCH] mptlan.c: fixed UNNECESSARY_CASTS warning

Vinesh Vilas Raut vineshraut2017 at gmail.com
Sat Aug 21 17:33:57 UTC 2021


On Fri, Aug 20, 2021 at 3:30 PM Lukas Bulwahn <lukas.bulwahn at gmail.com> wrote:
>
> On Thu, Aug 5, 2021 at 1:12 PM Vinesh Raut <vineshraut2017 at gmail.com> wrote:
> >
> > multiple UNNECESSARY_CASTS warnings fixed from mptlan.c

> So what is casted here? from which type to which type?
>From void pointer to struct sk_buff  pointer.

> Explain which type of bug here specifically would be hidden.
If a pointer is cast (wrongly), bugs like memory corruption,
segmentation faults can occur.
Also, It can affect functionality of the program.

> If you do that, it is much more comprehensible and clearer why this
> deserves to be addressed (or not).
First , it is redundant. It will be difficult to debug. May hide Bugs
if any due to
(wrongly) explicit casting


Regards,
-Vinesh Raut


More information about the Linux-kernel-mentees mailing list