lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200805212113.51936@marek.priv.at>
Date:	Wed, 21 May 2008 21:13:51 +0200
From:	Philipp Marek <philipp@...ek.priv.at>
To:	linux-kernel@...r.kernel.org
Subject: [patch] kmalloc returns (void*), don't do type conversions

Hello everybody,

as requested on http://kernelnewbies.org/KernelJanitors/Todo
here's a first patch that removes type conversion on
kmalloc() (which returns a (void*)):


It was done against current linus-git 
(d40ace0c7b4a329f7d869d0fbf27435543bb2acc, if I'm not mistaken),
and looks like that:
    list_del(&bss->list);
    local->num_bss_info--;
  } else {
-   bss = (struct hostap_bss_info *)
-     kmalloc(sizeof(*bss), GFP_ATOMIC);
+   bss = kmalloc(sizeof(*bss), GFP_ATOMIC);
    if (bss == NULL)
      return NULL;
  }


Most of the patch is auto-generated (by a script in 
http://kernelnewbies.org/KernelJanitors/Todo/VoidPointerConvs); 
but it is hand-changed in some parts to avoid checkpatch warnings:
- line length
- "foo* bar" to "foo *bar"
- space prohibited between function name and open parenthesis '('
  (like "sizeof (")

checkpatch didn't give any warnings or errors on this patch.
I tried a "make allyesconfig", but that gave some compile errors 
that don't seem related to my changes:
	drivers/block/cciss_scsi.c:75: error: ‘MAX_CTLR’ undeclared here (not in a function)
	drivers/block/cciss_scsi.c:76: error: field name not in record or union initializer


Please tell me if that's the correct approach; I'm sorry that I 
couldn't find out who the correct maintainer for these changes is.


Regards,

Phil


$ diffstat kmalloc-type-changes.patch
 arch/cris/arch-v32/mm/intmem.c                |   13 +++++--------
 arch/ia64/kernel/mca_drv.c                    |    4 ++--
 arch/powerpc/kernel/nvram_64.c                |    3 +--
 drivers/block/cciss.c                         |    3 +--
 drivers/block/cciss_scsi.c                    |    3 +--
 drivers/block/floppy.c                        |    3 +--
 drivers/i2c/i2c-dev.c                         |    3 +--
 drivers/isdn/capi/capidrv.c                   |    3 +--
 drivers/isdn/hisax/hfc_sx.c                   |    5 +++--
 drivers/media/video/vino.c                    |    8 ++++----
 drivers/message/i2o/i2o_config.c              |    3 +--
 drivers/mtd/maps/tqm8xxl.c                    |    2 +-
 drivers/net/gianfar.c                         |    6 ++----
 drivers/net/s2io.c                            |    4 ++--
 drivers/net/tulip/eeprom.c                    |    8 ++++----
 drivers/net/wireless/hostap/hostap_80211_rx.c |    3 +--
 drivers/net/wireless/hostap/hostap_ioctl.c    |    3 +--
 drivers/net/wireless/ipw2100.c                |   10 ++++------
 drivers/net/wireless/zd1211rw/zd_chip.c       |    2 +-
 drivers/s390/net/ctcm_mpc.c                   |    6 ++----
 drivers/s390/net/qeth_core_main.c             |    4 ++--
 drivers/scsi/osst.c                           |    5 ++---
 drivers/usb/storage/isd200.c                  |    3 +--
 fs/befs/btree.c                               |    4 ++--
 fs/ufs/util.c                                 |    3 +--
 net/ipv4/igmp.c                               |    3 +--
 net/ipv6/mcast.c                              |    3 +--
 net/sctp/protocol.c                           |    4 ++--
 security/selinux/ss/conditional.c             |    4 ++--
 29 files changed, 53 insertions(+), 75 deletions(-)


View attachment "kmalloc-type-changes.patch" of type "text/x-diff" (16334 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ