summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Blackfin: convert malloc()/memset() to zalloc() in module codeMike Frysinger2009-09-161-4/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: cleanup printk() usage in module codeMike Frysinger2009-09-161-34/+25
| | | | | | | Convert all printk() statements to use the common pr_xxx() funcs and use the new pr_fmt() function to standardize all of the output. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: reject outdated/unused/wrong relocation typesRobin Getz2009-09-161-34/+8
| | | | | | | | | | | All kernel modules are required to be built with -mlong-calls and thus should not generate any of these relocations. If they do, it means the module has not been compiled properly, so rather than trying to handle them (and running into random run time errors) just error out on module load to force the module to be compiled correctly. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: convert ptrace to new memory functionsMike Frysinger2009-09-161-57/+72
| | | | | | | | | Now that we have a Blackfin memory function to figure out how to properly access the different regions, drop the custom memory range checks in our ptrace code and use that. It makes the code nicer and fixes bugs where the ptrace logic wasn't handling all the different regions. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: cleanup traps decode_address() a bitMike Frysinger2009-09-161-18/+30
| | | | | | | Unify the address display to shrink the code, and add missing decoding of a few special Blackfin-specific regions (L1 ROM and MMRs). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: inline I-pipe bypass code in ret_from_exceptionPhilippe Gerum2009-09-162-12/+7
| | | | | Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: sanitize manual control of IPEND[4]Philippe Gerum2009-09-161-14/+11
| | | | | | | | | | | | | Cleanup is performed in two ways: - remove extraneous updates of IPEND[4] w/ CONFIG_IPIPE, and document remaining use. - substitute pop-reg-from-stack instructions with plain SP fixups in all save-RETI-then-discard patterns. Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: document __ipipe_call_irqtailPhilippe Gerum2009-09-161-0/+25
| | | | | Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: allow EVT5 to preempt irqtail prologue (CONFIG_DEBUG_HWERR)Philippe Gerum2009-09-161-1/+9
| | | | | Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: reuse evt_evt14 handler to perform irqtail epiloguePhilippe Gerum2009-09-161-23/+1
| | | | | Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: use generic name for EVT14 handlerPhilippe Gerum2009-09-164-6/+6
| | | | | | | | | | | | | | The purpose of the EVT14 handler may depend on whether CONFIG_IPIPE is enabled, albeit its implementation can be the same in both cases. When the interrupt pipeline is enabled, EVT14 can be used to raise the core priority level for the running code; when CONFIG_IPIPE is off, EVT14 can be used to lower this level before running softirq handlers. Rename evt14_softirq to evt_evt14 to pick an identifier that fits both, which allows to reuse the same vector setup code as well. Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: allow high priority domains to preempt schedule_tail()Philippe Gerum2009-09-161-2/+22
| | | | | | | | | | | | | | ret_from_fork is always entered with hw interrupts off, which prevents real-time domains to preempt the Linux kernel during part of the initial context switch to the new task, which could in turn raise the worst-case latency figures. To avoid this, stall the root domain stage in the interrupt pipeline to keep the scheduling tail code free from Linux-handled IRQs, then enable hardware interrupts again. Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: export show_stack() to modulesPhilippe Gerum2009-09-161-0/+1
| | | | | Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: fix misnomer of some I-pipe helpersPhilippe Gerum2009-09-163-33/+22
| | | | | | | | | | __ipipe_{stall, unstall}_root_raw() identifiers may leave the reader under the impression that only the virtual state is affected by these operations, which is wrong. Pick names following the convention used throughout the interrupt pipeline code. Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: checkpatch --file arch/blackfin/kernel/ipipe.cPhilippe Gerum2009-09-161-17/+19
| | | | | Signed-off-by: Philippe Gerum <rpm@xenomai.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: make EVT3->EVT5 lowering more robust wrt IPEND[4]Robin Getz2009-09-164-41/+66
| | | | | | | | | | | | | | | | | We handle many exceptions at EVT5 (hardware error level) so that we can catch exceptions in our exception handling code. Today - if the global interrupt enable bit (IPEND[4]) is set (interrupts disabled) our trap handling code goes into a infinite loop, since we need interrupts to be on to defer things to EVT5. Normal kernel code should not trigger this for any reason as IPEND[4] gets cleared early (when doing an interrupt context save) and the kernel stack there should be sane (or something much worse is happening in the system). But there have been a few times where this has happened, so this change makes sure we dump a proper crash message even when things have gone south. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: bf537-stamp: add resources for AD1938 audio cardBarry Song2009-09-161-0/+21
| | | | | Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: bf537-stamp: declare SPI IRQ resourcesYi Li2009-09-162-0/+7
| | | | | Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Blackfin: bf537-stamp: update ADP5588 header nameMichael Hennerich2009-09-161-1/+1
| | | | | Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6Linus Torvalds2009-09-1659-239/+1287
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: Driver Core: devtmpfs - kernel-maintained tmpfs-based /dev debugfs: Modify default debugfs directory for debugging pktcdvd. debugfs: Modified default dir of debugfs for debugging UHCI. debugfs: Change debugfs directory of IWMC3200 debugfs: Change debuhgfs directory of trace-events-sample.h debugfs: Fix mount directory of debugfs by default in events.txt hpilo: add poll f_op hpilo: add interrupt handler hpilo: staging for interrupt handling driver core: platform_device_add_data(): use kmemdup() Driver core: Add support for compatibility classes uio: add generic driver for PCI 2.3 devices driver-core: move dma-coherent.c from kernel to driver/base mem_class: fix bug mem_class: use minor as index instead of searching the array driver model: constify attribute groups UIO: remove 'default n' from Kconfig Driver core: Add accessor for device platform data Driver core: move dev_get/set_drvdata to drivers/base/dd.c Driver core: add new device to bus's list before probing
| * Driver Core: devtmpfs - kernel-maintained tmpfs-based /devKay Sievers2009-09-1511-7/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devtmpfs lets the kernel create a tmpfs instance called devtmpfs very early at kernel initialization, before any driver-core device is registered. Every device with a major/minor will provide a device node in devtmpfs. Devtmpfs can be changed and altered by userspace at any time, and in any way needed - just like today's udev-mounted tmpfs. Unmodified udev versions will run just fine on top of it, and will recognize an already existing kernel-created device node and use it. The default node permissions are root:root 0600. Proper permissions and user/group ownership, meaningful symlinks, all other policy still needs to be applied by userspace. If a node is created by devtmps, devtmpfs will remove the device node when the device goes away. If the device node was created by userspace, or the devtmpfs created node was replaced by userspace, it will no longer be removed by devtmpfs. If it is requested to auto-mount it, it makes init=/bin/sh work without any further userspace support. /dev will be fully populated and dynamic, and always reflect the current device state of the kernel. With the commonly used dynamic device numbers, it solves the problem where static devices nodes may point to the wrong devices. It is intended to make the initial bootup logic simpler and more robust, by de-coupling the creation of the inital environment, to reliably run userspace processes, from a complex userspace bootstrap logic to provide a working /dev. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Jan Blunck <jblunck@suse.de> Tested-By: Harald Hoyer <harald@redhat.com> Tested-By: Scott James Remnant <scott@ubuntu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * debugfs: Modify default debugfs directory for debugging pktcdvd.GeunSik Lim2009-09-151-1/+1
| | | | | | | | | | | | | | | | | | As we all know, We need change default directory for consistency of debugfs by Greg K-H Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * debugfs: Modified default dir of debugfs for debugging UHCI.GeunSik Lim2009-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change default debugfs directory as mounting point for debugging UHCI(Universal Host Controller Interface driver) for USB. As we all know, We need change default directory for consistency of debugfs by Greg K-H Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * debugfs: Change debugfs directory of IWMC3200GeunSik Lim2009-09-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Change default debugfs directory that mount for debugging IWMC3200(Intel Wireless Multicomm 3200 WiFi driver). As we all know, We need change default directory for consistency of debugfs by Greg.K.H Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * debugfs: Change debuhgfs directory of trace-events-sample.hGeunSik Lim2009-09-151-1/+1
| | | | | | | | | | | | | | | | Default directory of debug filesystem for ftrace is /sys/kernel/debug/. Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * debugfs: Fix mount directory of debugfs by default in events.txtGeunSik Lim2009-09-151-12/+12
| | | | | | | | | | | | | | | | | | We need common default directory of denbugfs for consistency. (debugfs's default directory is /sys/kernel/debug/ by debugfs.) Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * hpilo: add poll f_opDavid Altobelli2009-09-151-1/+41
| | | | | | | | | | | | | | | | Add poll handler to hpilo, to allow applications a low overhead method of waiting for data. Signed-off-by: David Altobelli <david.altobelli@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * hpilo: add interrupt handlerDavid Altobelli2009-09-152-45/+101
| | | | | | | | | | | | | | | | | | | | Add interrupt handler to hpilo. This is enablement for poll handler, and it also simplifies the logic for handling an iLO reset, because now only the interrupt handler needs to look for reset, the file system interfaces only need to return failure when a reset has happened. Signed-off-by: David Altobelli <david.altobelli@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * hpilo: staging for interrupt handlingDavid Altobelli2009-09-151-47/+73
| | | | | | | | | | | | | | | | Refactor some hpilo routines in order to allow for locking changes in interrupt handling. Should not be functionally different. Signed-off-by: David Altobelli <david.altobelli@hp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * driver core: platform_device_add_data(): use kmemdup()Andrew Morton2009-09-151-4/+4
| | | | | | | | | | | | | | Instead of open-coding it. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Driver core: Add support for compatibility classesJean Delvare2009-09-152-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When turning class devices into bus devices, we may need to temporarily add links in sysfs so that user-space applications are not confused. This is done by adding the following API: * Functions to register and unregister compatibility classes. These appear in sysfs at the same location as regular classes, but instead of class devices, they contain links to bus devices. * Functions to create and delete such links. Additionally, the caller can optionally pass a target device to which a "device" link should point (typically that would be the device's parent), to fully emulate the original class device. The i2c subsystem will be the first user of this API, as i2c adapters are being converted from class devices to bus devices. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
| * uio: add generic driver for PCI 2.3 devicesMichael S. Tsirkin2009-09-156-0/+389
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a generic uio driver that can bind to any PCI device. First user will be virtualization where a qemu userspace process needs to give guest OS access to the device. Interrupts are handled using the Interrupt Disable bit in the PCI command register and Interrupt Status bit in the PCI status register. All devices compliant to PCI 2.3 (circa 2002) and all compliant PCI Express devices should support these bits. Driver detects this support, and won't bind to devices which do not support the Interrupt Disable Bit in the command register. It's expected that more features of interest to virtualization will be added to this driver in the future. Possibilities are: mmap for device resources, MSI/MSI-X, eventfd (to interface with kvm), iommu. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Chris Wright <chrisw@redhat.com> Signed-off-by: Hans J. Koch <hjk@linutronix.de> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * driver-core: move dma-coherent.c from kernel to driver/baseMing Lei2009-09-153-1/+1
| | | | | | | | | | | | | | | | | | | | Placing dma-coherent.c in driver/base is better than in kernel, since it contains code to do per-device coherent dma memory handling. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * mem_class: fix bugJin Dongming2009-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I build and boot -next on fedora 10, I can not login anymore. When I input the user name and password, the system does not output any message and requires user to input the user name and password again and again. I find the patch which caused this problem with "GIT BISECT" command. And the patch is commit 7c4b7daa1878972ed0137c95f23569124bd6e2b1 "mem_class: use minor as index instead of searching the array". Though I don't know the real reason why user could not login, I confirmed the patch I made as following could resolve the problem on fedora 10. Signed-off-by: Jin Dongming <jin.dongming@np.css.fujitsu.com> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * mem_class: use minor as index instead of searching the arrayKay Sievers2009-09-151-42/+40
| | | | | | | | | | | | | | | | | | Declare the device list with the minor numbers as the index, which saves us from searching for a matching list entry. Remove old devfs permissions declaration. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * driver model: constify attribute groupsDavid Brownell2009-09-1530-39/+39
| | | | | | | | | | | | | | | | | | | | Let attribute group vectors be declared "const". We'd like to let most attribute metadata live in read-only sections... this is a start. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * UIO: remove 'default n' from KconfigDaniel Mack2009-09-151-5/+0
| | | | | | | | | | | | | | | | | | 'default n' is the default, there is no need for these lines. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Hans J. Koch <hjk@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Driver core: Add accessor for device platform dataMark Brown2009-09-151-0/+5
| | | | | | | | | | | | | | | | | | For consistency with driver data provide a dev_get_platdata() accessor for reading the platform data from a device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Driver core: move dev_get/set_drvdata to drivers/base/dd.cGreg Kroah-Hartman2009-09-154-20/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | No one should directly access the driver_data field, so remove the field and make it private. We dynamically create the private field now if it is needed, to handle drivers that call get/set before they are registered with the driver core. Also update the copyright notices on these files while we are there. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * Driver core: add new device to bus's list before probingAlan Stern2009-09-153-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1271) affects when new devices get linked into their bus's list of devices. Currently this happens after probing, and it doesn't happen at all if probing fails. Clearly this is wrong, because at that point quite a few symbolic links have already been created in sysfs. We are committed to adding the device, so it should be linked into the bus's list regardless. In addition, this needs to happen before the uevent announcing the new device gets issued. Otherwise user programs might try to access the device before it has been added to the bus. To fix both these problems, the patch moves the call to klist_add_tail() forward from bus_attach_device() to bus_add_device(). Since bus_attach_device() now does nothing but probe for drivers, it has been renamed to bus_probe_device(). And lastly, the kerneldoc is updated. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6Linus Torvalds2009-09-161267-214568/+297717
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (641 commits) Staging: remove sxg driver Staging: remove heci driver Staging: remove at76_usb wireless driver. Staging: rspiusb: remove the driver Staging: meilhaus: remove the drivers Staging: remove me4000 driver. Staging: line6: ffzb returns an unsigned integer Staging: line6: pod.c: style cleanups Staging: iio: introduce missing kfree Staging: dream: introduce missing kfree Staging: comedi: addi-data: NULL dereference of amcc in v_pci_card_list_init() Staging: vt665x: fix built-in compiling Staging: rt3090: enable NATIVE_WPA_SUPPLICANT_SUPPORT option Staging: rt3090: port changes in WPA_MIX_PAIR_CIPHER to rt3090 Staging: rt3090: rename device from raX to wlanX Staging: rt3090: remove possible conflict with rt2860 Staging: rt2860/rt2870/rt3070/rt3090: fix compiler warning on x86_64 Staging: rt2860: add new device ids Staging: rt3090: add device id 1462:891a Staging: asus_oled: Cleaned up checkpatch issues. ...
| * | Staging: remove sxg driverGreg Kroah-Hartman2009-09-1513-8184/+0
| | | | | | | | | | | | | | | | | | | | | | | | Unfortunatly, the upstream company has abandonded development of this driver. So it's best to just remove the driver from the tree. Cc: Christopher Harrer <charrer@alacritech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: remove heci driverGreg Kroah-Hartman2009-09-1514-6537/+0
| | | | | | | | | | | | | | | | | | | | | | | | Intel has officially abandoned this project and does not want to maintian it or have it included in the main kernel tree, as no one should use the code, it's not needed anymore. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: remove at76_usb wireless driver.Greg Kroah-Hartman2009-09-157-6291/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is already an in-kernel driver for this hardware (since 2.6.30), at76c50x-usb, and it supports all of the same devices. So this driver can now be deleted. Acked-by: Kalle Valo <kalle.valo@iki.fi> Cc: linux-wireless <linux-wireless@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: rspiusb: remove the driverGreg Kroah-Hartman2009-09-157-994/+0
| | | | | | | | | | | | | | | | | | | | | No one cares, it's a custom userspace interface, and the code hasn't built in a long time. So remove it. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: meilhaus: remove the driversGreg Kroah-Hartman2009-09-15133-41014/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comedi drivers should be used instead, no need to have these in here as well. Cc: David Kiliani <mail@davidkiliani.de> Cc: Meilhaus Support <support@meilhaus.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: remove me4000 driver.Greg Kroah-Hartman2009-09-159-22544/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The comedi drivers should be used instead, no need to have this driver in the tree duplicating that one. Cc: Wolfgang Beiter <w.beiter@aon.at> Cc: Guenter Gebhardt <g.gebhardt@meilhaus.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: line6: ffzb returns an unsigned integerFrederik Deweerdt2009-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | find_first_zero_bit returns a positive value, use it accordingly. Signed-off-by: Frederik Deweerdt <frederik.deweerdt@xprog.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: line6: pod.c: style cleanupsFrederik Deweerdt2009-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Line6 pod.c: Minor style cleanups Signed-off-by: Frederik Deweerdt <frederik.deweerdt@xprog.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Staging: iio: introduce missing kfreeJulia Lawall2009-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handling code following a kmalloc or kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk>
OpenPOWER on IntegriCloud