drivers: modem: gsm: Do not reference possible null pointer
The ppp_dev was used even if its value could be NULL. Fixes #25781 Coverity-CID: 210031 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
a2d4292a96
commit
d81be8fd9c
1 changed files with 2 additions and 2 deletions
|
@ -244,14 +244,14 @@ static int gsm_setup_mccmno(struct gsm_modem *gsm)
|
||||||
static void set_ppp_carrier_on(struct gsm_modem *gsm)
|
static void set_ppp_carrier_on(struct gsm_modem *gsm)
|
||||||
{
|
{
|
||||||
struct device *ppp_dev = device_get_binding(CONFIG_NET_PPP_DRV_NAME);
|
struct device *ppp_dev = device_get_binding(CONFIG_NET_PPP_DRV_NAME);
|
||||||
const struct ppp_api *api =
|
const struct ppp_api *api;
|
||||||
(const struct ppp_api *)ppp_dev->driver_api;
|
|
||||||
|
|
||||||
if (!ppp_dev) {
|
if (!ppp_dev) {
|
||||||
LOG_ERR("Cannot find PPP %s!", "device");
|
LOG_ERR("Cannot find PPP %s!", "device");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
api = (const struct ppp_api *)ppp_dev->driver_api;
|
||||||
api->start(ppp_dev);
|
api->start(ppp_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue