From: jsg Date: Wed, 12 Oct 2022 11:29:53 +0000 (+0000) Subject: use correct type with sizeof X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ddd5e87dd01248417653de3a07b509d56c127622;p=openbsd use correct type with sizeof ok miod@ kettenis@ --- diff --git a/sys/arch/arm64/dev/apldma.c b/sys/arch/arm64/dev/apldma.c index 814d055f485..8390003a3de 100644 --- a/sys/arch/arm64/dev/apldma.c +++ b/sys/arch/arm64/dev/apldma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apldma.c,v 1.2 2022/07/27 20:18:46 kettenis Exp $ */ +/* $OpenBSD: apldma.c,v 1.3 2022/10/12 11:29:53 jsg Exp $ */ /* * Copyright (c) 2022 Mark Kettenis * @@ -159,7 +159,7 @@ apldma_attach(struct device *parent, struct device *self, void *aux) goto unmap; } sc->sc_ac = mallocarray(sc->sc_nchannels, - sizeof(struct apldma_channel), M_DEVBUF, M_WAITOK | M_ZERO); + sizeof(struct apldma_channel *), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_dmat = faa->fa_dmat; sc->sc_node = faa->fa_node; @@ -180,7 +180,7 @@ apldma_attach(struct device *parent, struct device *self, void *aux) free: free(sc->sc_ac, M_DEVBUF, - sc->sc_nchannels * sizeof(struct apldma_channel)); + sc->sc_nchannels * sizeof(struct apldma_channel *)); unmap: bus_space_unmap(sc->sc_iot, sc->sc_ioh, faa->fa_reg[0].size); }