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


Groups > linux.kernel > #1499422

Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf()

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf()
Date 2016-10-12 10:30 +0200
Message-ID <srn5f-1KJ-3@gated-at.bofh.it> (permalink)
References (1 earlier) <spcH0-6dt-53@gated-at.bofh.it> <spda1-6DS-23@gated-at.bofh.it> <spda1-6DS-21@gated-at.bofh.it> <spyet-5tC-17@gated-at.bofh.it> <sqIEO-1J7-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Compare:

	foo = kmalloc(sizeof(*foo), GFP_KERNEL);

This says you are allocating enough space for foo.  It can be reviewed
by looking at one line.  If you change the type of foo it will still
work.

	foo = kmalloc(sizeof(struct whatever), GFP_KERNEL);

There isn't enough information to say if this is correct.  If you change
the type of foo then you have to update the allocation as well.

It's not a super common type of bug, but I see it occasionally.

regards,
dan carpenter

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


Thread

Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Richard Weinberger <richard.weinberger@gmail.com> - 2016-10-06 11:30 +0200
  Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-07 10:00 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Richard Weinberger <richard@nod.at> - 2016-10-07 10:20 +0200
    Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 11:00 +0200
      Re: md/raid1: Improve another size determination in setup_conf() Richard Weinberger <richard@nod.at> - 2016-10-07 11:10 +0200
        Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 13:00 +0200
          Re: md/raid1: Improve another size determination in setup_conf() "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2016-10-07 14:00 +0200
            Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 17:30 +0200
              Re: md/raid1: Improve another size determination in setup_conf() Jiri Kosina <jikos@kernel.org> - 2016-10-07 17:40 +0200
                Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 18:40 +0200
                Re: md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 15:20 +0200
      Re: md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 15:10 +0200
        Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-10 15:30 +0200
          Re: md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 16:10 +0200
            Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-10 16:30 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 15:20 +0200
      Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-12 10:30 +0200
        Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-12 14:20 +0200
  Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-10 13:20 +0200
    Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-10 14:30 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Bjørn Mork <bjorn@mork.no> - 2016-10-10 16:10 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-11 08:30 +0200

csiph-web