Hi Dan, On Fri, Jul 14, 2017 at 9:37 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote: > The patch f907c9ea8835: "serial: sh-sci: Add support for > GPIO-controlled modem lines" from Jun 3, 2016, leads to the following > static checker warning: > > drivers/tty/serial/sh-sci.c:3112 sci_probe_single() > error: 'sciport->gpios' dereferencing possible ERR_PTR() > > drivers/tty/serial/sh-sci.c > 3107 ret = sci_init_single(dev, sciport, index, p, false); > 3108 if (ret) > 3109 return ret; > 3110 > 3111 sciport->gpios = mctrl_gpio_init(&sciport->port, 0); > 3112 if (IS_ERR(sciport->gpios) && PTR_ERR(sciport->gpios) != -ENOSYS) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Assume it is -ENOSYS. Which is the case (only) if CONFIG_GPIOLIB=n. > 3113 return PTR_ERR(sciport->gpios); > 3114 > 3115 if (sciport->has_rtscts) { > 3116 if (!IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios, > ^^^^^^^^^^^^^^ > It looks like we would Oops here (inside the function. No, it won't as mctrl_gpio_to_gpiod() is a dummy returning -ENOSYS if CONFIG_GPIOLIB=n. > 3117 UART_GPIO_CTS)) || > 3118 !IS_ERR_OR_NULL(mctrl_gpio_to_gpiod(sciport->gpios, > 3119 UART_GPIO_RTS))) { > 3120 dev_err(&dev->dev, "Conflicting RTS/CTS config\n"); > 3121 return -EINVAL; > 3122 } > 3123 sciport->port.flags |= UPF_HARD_FLOW; > 3124 } > 3125 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html