Bug 194228 - Looks like longstanding cut & paste error in nand_generic.c
Summary: Looks like longstanding cut & paste error in nand_generic.c
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-STABLE
Hardware: arm Any
: --- Affects Some People
Assignee: Christian Brueffer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-07 16:59 UTC by David Horwitt
Modified: 2015-07-15 12:00 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Horwitt 2014-10-07 16:59:07 UTC
FBSDID("$FreeBSD: stable/10/sys/dev/nand/nand_generic.c 259371 2013-12-14 00:54:05Z ian $");
10.1-BETA2 from 20140925

Line 395:
chip_params->spare_bytes_per_page = le32dec(&params.spare_bytes_per_page);

should be
chip_params->spare_bytes_per_page = le16dec(&params.spare_bytes_per_page);

On my AT91SAM9G20-based system (EMAC SOM-9G20M, 64 MB SDRAM) onfi_is_blk_bad()
hung trying to malloc 0x20000040 bytes instead of 0x40.


Thanks; FBSD rocks!
Comment 1 Marcus von Appen freebsd_committer freebsd_triage 2015-02-18 11:54:19 UTC
Updated 10.1-BETA and 10.1-RC versioned bugs to 10.1-STABLE.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-07-01 14:54:20 UTC
A commit references this bug:

Author: brueffer
Date: Wed Jul  1 14:54:14 UTC 2015
New revision: 285006
URL: https://svnweb.freebsd.org/changeset/base/285006

Log:
  Use the correct le*dec function to decode a 16bit type.

  PR:		194228
  Submitted by:	David Horwitt
  MFC after:	2 weeks

Changes:
  head/sys/dev/nand/nand_generic.c
Comment 3 Christian Brueffer freebsd_committer freebsd_triage 2015-07-01 14:56:26 UTC
Good catch David!  I have committed this to HEAD and will merge it to the STABLE branches soon.

Sorry for the long delay in getting this fixed.
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-07-15 11:58:57 UTC
A commit references this bug:

Author: brueffer
Date: Wed Jul 15 11:58:31 UTC 2015
New revision: 285599
URL: https://svnweb.freebsd.org/changeset/base/285599

Log:
  MFC: r285006

  Use the correct le*dec function to decode a 16bit type.

  PR:		194228
  Submitted by:	David Horwitt
  Approved by:	re (marius)

Changes:
_U  stable/10/
  stable/10/sys/dev/nand/nand_generic.c
Comment 5 Christian Brueffer freebsd_committer freebsd_triage 2015-07-15 12:00:19 UTC
Merged and will be in 10.2-RELEASE. Thanks again!