mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Remove NULL checks after M_WAITOK allocations, which - by definition - can
never return NULL. Reviewed by: arybchik@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5773
This commit is contained in:
parent
316e15b4cc
commit
9b0488ed2a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297452
@ -250,10 +250,6 @@ sfxge_mcdi_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mcdibuf = malloc(SFXGE_MCDI_MAX_PAYLOAD, M_TEMP, M_WAITOK | M_ZERO);
|
mcdibuf = malloc(SFXGE_MCDI_MAX_PAYLOAD, M_TEMP, M_WAITOK | M_ZERO);
|
||||||
if (mcdibuf == NULL) {
|
|
||||||
rc = ENOMEM;
|
|
||||||
goto fail4;
|
|
||||||
}
|
|
||||||
if ((rc = copyin(ip->u.mcdi.payload, mcdibuf, ip->u.mcdi.len)) != 0) {
|
if ((rc = copyin(ip->u.mcdi.payload, mcdibuf, ip->u.mcdi.len)) != 0) {
|
||||||
goto fail5;
|
goto fail5;
|
||||||
}
|
}
|
||||||
@ -292,7 +288,6 @@ sfxge_mcdi_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip)
|
|||||||
fail6:
|
fail6:
|
||||||
fail5:
|
fail5:
|
||||||
free(mcdibuf, M_TEMP);
|
free(mcdibuf, M_TEMP);
|
||||||
fail4:
|
|
||||||
fail3:
|
fail3:
|
||||||
fail2:
|
fail2:
|
||||||
fail1:
|
fail1:
|
||||||
|
@ -75,10 +75,6 @@ sfxge_nvram_rw(struct sfxge_softc *sc, sfxge_ioc_t *ip, efx_nvram_type_t type,
|
|||||||
goto fail1;
|
goto fail1;
|
||||||
|
|
||||||
buf = malloc(chunk_size, M_TEMP, M_WAITOK);
|
buf = malloc(chunk_size, M_TEMP, M_WAITOK);
|
||||||
if (buf == NULL) {
|
|
||||||
rc = ENOMEM;
|
|
||||||
goto fail2;
|
|
||||||
}
|
|
||||||
|
|
||||||
off = 0;
|
off = 0;
|
||||||
while (total_size) {
|
while (total_size) {
|
||||||
@ -108,7 +104,6 @@ sfxge_nvram_rw(struct sfxge_softc *sc, sfxge_ioc_t *ip, efx_nvram_type_t type,
|
|||||||
|
|
||||||
fail3:
|
fail3:
|
||||||
free(buf, M_TEMP);
|
free(buf, M_TEMP);
|
||||||
fail2:
|
|
||||||
efx_nvram_rw_finish(enp, type);
|
efx_nvram_rw_finish(enp, type);
|
||||||
fail1:
|
fail1:
|
||||||
return (rc);
|
return (rc);
|
||||||
|
Loading…
Reference in New Issue
Block a user