Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b7df122 authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Greg Kroah-Hartman
Browse files

staging: gdm724x: correct kzalloc/kmalloc sizeof argument



This patch converts sizeof(TYPE) to sizeof(VAR) when used as
a kzalloc/kmaloc argument.

Signed-off-by: default avatarIoana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba7f55b7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static struct mux_tx *alloc_mux_tx(int len)
{
	struct mux_tx *t = NULL;

	t = kzalloc(sizeof(struct mux_tx), GFP_ATOMIC);
	t = kzalloc(sizeof(*t), GFP_ATOMIC);
	if (!t)
		return NULL;

@@ -96,7 +96,7 @@ static struct mux_rx *alloc_mux_rx(void)
{
	struct mux_rx *r = NULL;

	r = kzalloc(sizeof(struct mux_rx), GFP_KERNEL);
	r = kzalloc(sizeof(*r), GFP_KERNEL);
	if (!r)
		return NULL;

@@ -526,11 +526,11 @@ static int gdm_mux_probe(struct usb_interface *intf,
	if (bInterfaceNumber != 2)
		return -ENODEV;

	mux_dev = kzalloc(sizeof(struct mux_dev), GFP_KERNEL);
	mux_dev = kzalloc(sizeof(*mux_dev), GFP_KERNEL);
	if (!mux_dev)
		return -ENOMEM;

	tty_dev = kzalloc(sizeof(struct tty_dev), GFP_KERNEL);
	tty_dev = kzalloc(sizeof(*tty_dev), GFP_KERNEL);
	if (!tty_dev) {
		ret = -ENOMEM;
		goto err_free_mux;
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ int register_lte_tty_device(struct tty_dev *tty_dev, struct device *device)

	for (i = 0; i < TTY_MAX_COUNT; i++) {

		gdm = kmalloc(sizeof(struct gdm), GFP_KERNEL);
		gdm = kmalloc(sizeof(*gdm), GFP_KERNEL);
		if (!gdm)
			return -ENOMEM;

+5 −5
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ static struct usb_tx *alloc_tx_struct(int len)
	struct usb_tx *t = NULL;
	int ret = 0;

	t = kzalloc(sizeof(struct usb_tx), GFP_ATOMIC);
	t = kzalloc(sizeof(*t), GFP_ATOMIC);
	if (!t) {
		ret = -ENOMEM;
		goto out;
@@ -125,7 +125,7 @@ static struct usb_tx_sdu *alloc_tx_sdu_struct(void)
{
	struct usb_tx_sdu *t_sdu;

	t_sdu = kzalloc(sizeof(struct usb_tx_sdu), GFP_KERNEL);
	t_sdu = kzalloc(sizeof(*t_sdu), GFP_KERNEL);
	if (!t_sdu)
		return NULL;

@@ -183,7 +183,7 @@ static struct usb_rx *alloc_rx_struct(void)
	struct usb_rx *r = NULL;
	int ret = 0;

	r = kmalloc(sizeof(struct usb_rx), GFP_KERNEL);
	r = kmalloc(sizeof(*r), GFP_KERNEL);
	if (!r) {
		ret = -ENOMEM;
		goto out;
@@ -830,11 +830,11 @@ static int gdm_usb_probe(struct usb_interface *intf,
		return -ENODEV;
	}

	phy_dev = kzalloc(sizeof(struct phy_dev), GFP_KERNEL);
	phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
	if (!phy_dev)
		return -ENOMEM;

	udev = kzalloc(sizeof(struct lte_udev), GFP_KERNEL);
	udev = kzalloc(sizeof(*udev), GFP_KERNEL);
	if (!udev) {
		ret = -ENOMEM;
		goto err_udev;