-/* $OpenBSD: sdhc.c,v 1.53 2017/01/21 05:42:04 guenther Exp $ */
+/* $OpenBSD: sdhc.c,v 1.54 2017/04/06 03:15:29 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
return 0;
err:
- free(hp, M_DEVBUF, 0);
+ free(hp, M_DEVBUF, sizeof *hp);
sc->sc_host[sc->sc_nhosts - 1] = NULL;
sc->sc_nhosts--;
return (error);
-/* $OpenBSD: sdmmc.c,v 1.45 2017/01/21 05:42:04 guenther Exp $ */
+/* $OpenBSD: sdmmc.c,v 1.46 2017/04/06 03:15:29 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
/* Mask off unsupported voltage levels and select the lowest. */
DPRINTF(1,("%s: host_ocr=%x ", DEVNAME(sc), host_ocr));
host_ocr &= card_ocr;
- for (bit = 4; bit < 23; bit++) {
+b for (bit = 4; bit < 23; bit++) {
if (ISSET(host_ocr, 1<<bit)) {
host_ocr &= 3<<bit;
break;
void
sdmmc_function_free(struct sdmmc_function *sf)
{
- free(sf, M_DEVBUF, 0);
+ free(sf, M_DEVBUF, sizeof *sf);
}
/*
exec_done:
if (ucmd->c_data)
- free(data, M_TEMP, 0);
+ free(data, M_TEMP, ucmd->c_datalen);
break;
default:
-/* $OpenBSD: sdmmc_mem.c,v 1.29 2016/05/05 20:40:48 kettenis Exp $ */
+/* $OpenBSD: sdmmc_mem.c,v 1.30 2017/04/06 03:15:29 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
out:
if (ptr != NULL)
- free(ptr, M_DEVBUF, 0);
+ free(ptr, M_DEVBUF, datalen);
return error;
}
-/* $OpenBSD: sdmmc_scsi.c,v 1.38 2017/01/21 05:42:04 guenther Exp $ */
+/* $OpenBSD: sdmmc_scsi.c,v 1.39 2017/04/06 03:15:29 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
sdmmc_free_ccbs(scbus);
free_sctgt:
free(scbus->sc_tgt, M_DEVBUF, 0);
- free(scbus, M_DEVBUF, 0);
+ free(scbus, M_DEVBUF, sizeof *scbus);
}
void
free(scbus->sc_tgt, M_DEVBUF, 0);
sdmmc_free_ccbs(scbus);
- free(scbus, M_DEVBUF, 0);
+ free(scbus, M_DEVBUF, sizeof *scbus);
sc->sc_scsibus = NULL;
}