Bug 209636 - usr/src/sys/dev/usb/controller/generic_ohci.c:169: possible bad size ?
Summary: usr/src/sys/dev/usb/controller/generic_ohci.c:169: possible bad size ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-19 10:53 UTC by David Binderman
Modified: 2016-05-19 11:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2016-05-19 10:53:11 UTC
[usr/src/sys/dev/usb/controller/generic_ohci.c:169]: (warning) Size of pointer 'clkp' used instead of size of its data.

Source code is

  clkp = malloc(sizeof(clkp), M_DEVBUF, M_WAITOK | M_ZERO);

Maybe better code

  clkp = malloc(sizeof(*clkp), M_DEVBUF, M_WAITOK | M_ZERO);
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-05-19 11:02:48 UTC
A commit references this bug:

Author: hselasky
Date: Thu May 19 11:02:39 UTC 2016
New revision: 300200
URL: https://svnweb.freebsd.org/changeset/base/300200

Log:
  Fix bad sizeof().

  Submitted by:	David Binderman <dcb314@hotmail.com>
  PR:	209636

Changes:
  head/sys/dev/usb/controller/generic_ohci.c