1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

lint: fix possible nullptr deref in *pwr

This commit is contained in:
Hinnerk van Bruinehsen 2014-11-28 01:05:07 +01:00
parent 7f9fb2bea3
commit e7d0a7664f

View File

@ -617,6 +617,10 @@ int nrf24l01p_set_power(nrf24l01p_t *dev, int *pwr)
nrf24l01p_read_reg(dev, REG_RF_SETUP, &rf_setup);
if (pwr == NULL) {
return -1;
}
if (*pwr >= -3) {
rf_setup &= ~(3 << 1);
rf_setup |= (NRF24L01P_PWR_0DBM << 1);