Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1491376

[PATCH 2/5] ISDN-Gigaset: Improve another size determination in gigaset_initcs()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/5] ISDN-Gigaset: Improve another size determination in gigaset_initcs()
Date 2016-09-26 17:50 +0200
Message-ID <slGki-5BO-13@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <slGaB-5yk-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 25 Sep 2016 22:32:14 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/isdn/gigaset/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index cecbb6a..f505b42 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -710,7 +710,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
 	cs->mode = M_UNKNOWN;
 	cs->mstate = MS_UNINITIALIZED;
 	cs->bcs = kmalloc_array(channels, sizeof(*cs->bcs), GFP_KERNEL);
-	cs->inbuf = kmalloc(sizeof(struct inbuf_t), GFP_KERNEL);
+	cs->inbuf = kmalloc(sizeof(*cs->inbuf), GFP_KERNEL);
 	if (!cs->bcs || !cs->inbuf) {
 		pr_err("out of memory\n");
 		goto error;
-- 
2.10.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:40 +0200
  [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:40 +0200
    Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 13:40 +0200
      Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 18:50 +0200
        Re: [PATCH 1/5] ISDN-Gigaset: Use kmalloc_array() in two functions Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 19:50 +0200
  [PATCH 2/5] ISDN-Gigaset: Improve another size determination in  gigaset_initcs() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
  [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 23:20 +0200
      Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:30 +0200
        Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-27 10:50 +0200
          Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 11:40 +0200
            Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure Paul Bolle <pebolle@tiscali.nl> - 2016-09-27 11:50 +0200
            Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 12:30 +0200
              Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 13:40 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 14:10 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure isdn@linux-pingi.de - 2016-09-27 14:20 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 15:00 +0200
                Re: [Gigaset307x-common] ISDN-Gigaset: Release memory in  gigaset_initcs() after an allocation failure Tilman Schmidt <tilman@imap.cc> - 2016-09-27 16:40 +0200
      Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:40 +0200
      Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 17:20 +0200
    Re: [PATCH 4/5] ISDN-Gigaset: Release memory in gigaset_initcs()  after an allocation failure Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:20 +0200
      Re: ISDN-Gigaset: Release memory in gigaset_initcs() after an  allocation failure SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 09:30 +0200
  [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed memory  allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed  memory allocation Tilman Schmidt <tilman@imap.cc> - 2016-09-27 13:00 +0200
      Re: [PATCH 3/5] ISDN-Gigaset: Delete an error message for a failed  memory allocation Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 13:50 +0200
  [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 17:50 +0200
    RE: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses David Laight <David.Laight@ACULAB.COM> - 2016-09-26 18:10 +0200
      Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses Joe Perches <joe@perches.com> - 2016-09-26 18:30 +0200
        Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 18:50 +0200
          Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Julia Lawall <julia.lawall@lip6.fr> - 2016-09-26 19:00 +0200
        [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 19:50 +0200
          Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 20:40 +0200
            Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 20:50 +0200
          Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses David Miller <davem@davemloft.net> - 2016-09-27 02:20 +0200
            Re: [PATCH v2 5/5] ISDN-Gigaset: Enclose two expressions for the  sizeof operator by parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:40 +0200
    Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-26 19:40 +0200
      Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator by  parentheses SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-26 20:10 +0200
        Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator  by parentheses Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 20:40 +0200
      Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:10 +0200
        Re: [PATCH 5/5] ISDN-Gigaset: Enclose two expressions for the sizeof  operator by parentheses Dan Carpenter <dan.carpenter@oracle.com> - 2016-09-27 09:30 +0200
  Re: [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-26 22:40 +0200
    Re: ISDN-Gigaset: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-27 07:20 +0200
  Re: [PATCH 0/5] ISDN-Gigaset: Fine-tuning for three function  implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 14:00 +0200
    Re: ISDN-Gigaset: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-28 19:00 +0200
      Re: ISDN-Gigaset: Fine-tuning for three function implementations Paul Bolle <pebolle@tiscali.nl> - 2016-09-28 20:00 +0200

csiph-web