NetBSD-Bugs archive

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

kern/51259: src/sys/net/if_mpls.c:464: possible bad return ?



>Number:         51259
>Category:       kern
>Synopsis:       src/sys/net/if_mpls.c:464: possible bad return ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 20 13:45:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160620
>Organization:
>Environment:
>Description:
src/sys/net/if_mpls.c:464]: (style) Variable 'ret' is not assigned a value.

Source code is

#ifdef INET
        ret = ip_if_output(ifp, m, rt->rt_gateway, rt);
#else
        if_output_lock(ifp, ifp, m, rt->rt_gateway, rt);
#endif
        return ret;

and

    int ret;

So there are some paths through the code where uninitialised
rubbish off the stack is the return value.

Suggest avoid. Maybe init ret to some sensible value
at its declaration might be a good idea.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index