ip link set can0 up type can - crash in kernel

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ip link set can0 up type can - crash in kernel

1,371 Views
fatalfeel
Contributor V

in Target terminal input command

root@matrix_io:/ # ip link set can0 up type can

crash in linux kernel

0 Kudos
2 Replies

927 Views
igorpadykov
NXP Employee
NXP Employee

Hi jesse

for flexcan configuaration one can look at i.MX6 Sabre AI dts:

arch/arm/boot/dts/imx6qdl-sabreauto.dtsi

http://git.freescale.com/git/cgit.cgi/imx/linux-imx.git/tree/arch/arm/boot/dts/imx6qdl-sabreauto.dts... 

and check sect.5.1 Build configurations attached Yocto Guide.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

927 Views
fatalfeel
Contributor V

in myandroid/kernel_imx/drivers/net/can/dev.c

static int can_validate(struct nlattr *tb[], struct nlattr *data[])
{
    bool is_can_fd = false;

    /* begin: issue #: prevent  crash */
    if( data != NULL ) //add this can prevent from crash
    {
        if (data[IFLA_CAN_CTRLMODE]) {
            struct can_ctrlmode *cm = nla_data(data[IFLA_CAN_CTRLMODE]);

            is_can_fd = cm->flags & cm->mask & CAN_CTRLMODE_FD;
        }

        if (is_can_fd) {
            if (!data[IFLA_CAN_BITTIMING] || !data[IFLA_CAN_DATA_BITTIMING])
                return -EOPNOTSUPP;
        }

        if (data[IFLA_CAN_DATA_BITTIMING]) {
            if (!is_can_fd || !data[IFLA_CAN_BITTIMING])
                return -EOPNOTSUPP;
        }

        return 0;
    }

    return -ENODATA;
    /* end: issue #: prevent  crash */
}

0 Kudos