This patch fix following issues reported by Dan:-
1) There is no check limiting the size to 32 and it could be up to
253 bytes.
2) Use defines instead of magic numbers.
3) The oz_farewell struct is supposed to be a variable length struct
but the variable part is put in the middle. It doesn't make any
sense to put the length of the variable size array after then end
of the array because we can never find it again! Put the
variable size array at the end. Make it a zero length array.
u8 len;
u8 report[0];
4) In oz_add_farewell() we do this:
f = kmalloc(sizeof(struct oz_farewell) + len - 1, GFP_ATOMIC);
The "- 1" refers to sizeof(f->report) but because it was a magic
number then it was missed when the sizeof(f->report) changed.
5) In [patch 6/6] we set the ->len member. But because it is at the
end of a variable length array with no limit check the remote
attacker can just rewrite it using the memcpy() on the next line.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes following build warning.
drivers/built-in.o: In function `oz_hcd_heartbeat':
>> (.text+0x30aadd): undefined reference to `__divdi3'
drivers/built-in.o: In function `oz_hcd_heartbeat':
>> (.text+0x30ac85): undefined reference to `__divdi3'
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Free sc->sc_page when releasing a struct o2net_sock_container
object to avoid memory leaks.
This issue has been fixed by Younger Liu for OCFS2, so I sync
that patch to zcache as we share the same network code base.
Cc: Younger Liu <younger.liu@huawei.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There has been a lot of good work going into IIO recently, some of which
missed this pull request purely because I haven't caught up with all my
emails.
Core changes
1) Introduction of devm_iio_device_alloc/free and conversions of lots of
drivers (37 + patches so far mostly from Sachin)
2) A Kconfig option to enabled some debug logging subsystem wide.
New drivers
1) Nuvoton NAU7802 adc driver
2) Avago APDS9300 ambient light sensor driver.
Staging graduations
1) ADIS16260 gyroscope (after a lot fo cleaning up from Lars-Peter)
New driver features
1) ST-sensors gain control of which pin is used for dataready.
2) mcp4725 gains eeprom saving (a later fix deals with a wrong return type
bug in that patch)
3) A number of drivers have gained module alias' to aid autoloading.
Cleanups and minor bug fixes.
1) A number of typos in Kconfig comments
2) Drop remaining mentions of ring buffers (now just buffers)
3) Overrestrictive i2c function checking in the invensense mpu6050 driver
4) Some help text clarifications.
5) store_eeprom is now used in several drivers so move to generic abi docs.
6) Update dac power down options.
7) Add some error handlign to mxs-lradc on stmp_reset_block call.
8) Lars fixed the alphabetical order in various files and added comments
to try and prevent them getting messed up again.
9) Dropped some remaining 'reset' attributes for drivers. We have never
seen a reason why these should be available. Finally the macro
used to define many of these has gone.
10) lps331ap gets an easier to check temperature scale implementation.
11) Various cleanups for the hmc5843 from Peter with a view to getting
it ready for a staging graduation.
Quite a few other little typo fixes etc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
iQIcBAABAgAGBQJR/ofcAAoJEFSFNJnE9BaIN00QALxIW/4uP3/Ebv7jDJtOA1Ow
zzmsEfvDelAlqV+LZM97l7vHPRDrZY7PgDmOtDQZPsRdawnXH1rUopj0oxVWLiYv
NGDagCi2D5kPbR67/79n0ArNBvTo15EluxrcxDvMDTLX2QRUCrV0a67TFemT/Ooy
rvYEwLau/nUrxdwwGayxx81Pxy2Xke6wwvCfa/+pZqZv8q8GkKGDbhXfZdsW968t
0zgOSh+MyxfvEfeRam+kwZ806AAbz34c0b9aVSGCzTS8ZQ8kuxMBFhNgICVWEzoK
zS/sx0jbIsoTPUF+lwoluSYx15fih1t5sktYD4rAOo2HBVyYNM9GgOjbazU/Mskb
2mNkAkWboxvfccuBaIB4wRSTa/e33d/qTczs62e7MEcUCWnHmfzsdUJOiZwJJLSk
WhxoVaom16ze+EEPqQ8rWRRqI4nn4bP0bBSuZ+uptHA45VUokyHj8eIVkuZa34Lm
HQPiiF647kFsBnWOEZVxGsku0BSVjZWBpOyr95OOOtJcNMvxpBfDF21mtWpZtC4u
UCMnDBsHmyK/z8VXTtUXQ1PePrc8YKZajMJypcUEq9dcd5ymlvUf2gVsnoGLn4Zb
vhpov//UR+OVRoZOOfbWhnRhUS3zx7+b9+qNhN/9UYN5lxx8zy9YyRJEWOcBbaQu
k+KzLiEZrtAVeZ7+WT05
=gGdq
-----END PGP SIGNATURE-----
Merge tag 'iio-for-3.12a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First round of new IIO drivers, features and cleanups for the 3.12 cycle.
There has been a lot of good work going into IIO recently, some of which
missed this pull request purely because I haven't caught up with all my
emails.
Core changes
1) Introduction of devm_iio_device_alloc/free and conversions of lots of
drivers (37 + patches so far mostly from Sachin)
2) A Kconfig option to enabled some debug logging subsystem wide.
New drivers
1) Nuvoton NAU7802 adc driver
2) Avago APDS9300 ambient light sensor driver.
Staging graduations
1) ADIS16260 gyroscope (after a lot fo cleaning up from Lars-Peter)
New driver features
1) ST-sensors gain control of which pin is used for dataready.
2) mcp4725 gains eeprom saving (a later fix deals with a wrong return type
bug in that patch)
3) A number of drivers have gained module alias' to aid autoloading.
Cleanups and minor bug fixes.
1) A number of typos in Kconfig comments
2) Drop remaining mentions of ring buffers (now just buffers)
3) Overrestrictive i2c function checking in the invensense mpu6050 driver
4) Some help text clarifications.
5) store_eeprom is now used in several drivers so move to generic abi docs.
6) Update dac power down options.
7) Add some error handlign to mxs-lradc on stmp_reset_block call.
8) Lars fixed the alphabetical order in various files and added comments
to try and prevent them getting messed up again.
9) Dropped some remaining 'reset' attributes for drivers. We have never
seen a reason why these should be available. Finally the macro
used to define many of these has gone.
10) lps331ap gets an easier to check temperature scale implementation.
11) Various cleanups for the hmc5843 from Peter with a view to getting
it ready for a staging graduation.
Quite a few other little typo fixes etc.
avoid polling data ready bit forever; msleep() may be too long
for high sampling frequencies but the driver interface does not
support buffering
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Shubhrajyoti Datta <shubhrajyoti@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
I2C is generally not probed for devices other than those commonly found
on architectures where device treeor board files are not used. Note also
that this implementation does not fill in the name field of the
i2c_board_info structure as the documentation states it must. Hence
it is unlikely anyone is actually using it.
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Shubhrajyoti Datta <shubhrajyoti@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Use struct proc_dir_entry like the rest of the kernel does.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This moves the PUSH_JOURNAL and friend macros into debug.c, as that's
the only place they are used, so why are they even a macro?
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use struct task_struct instead.
Also remove the unused libcfs_current() function, while I noticed it
doing this conversion.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It's just a long, so remove the typedef and use long.
Side note, all the functions like waitq_* should be removed as well,
they are wrapping functions that don't really do what it seems that they
do based on their name.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Just use DECLARE_WAIT_QUEUE_HEAD() instead.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These weren't ever used, so just remove them.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Open code the module_init/module_exit lines, and also use
MODULE_VERSION, as it seems that was intended, but just never hooked up
at all.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Just call them directly, like the rest of the kernel does.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use "struct group_info" like the rest of the kernel, not a typedef.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use "struct module" like the rest of the kernel, not a typedef.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These aren't used, so remove them.
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
It was just a wrapper around for_each_possible_cpu()
Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The drivers is in more or less good shape, conforms to the IIO ABI and none of
the default static code checker report any problems, so move it out of staging.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The values presented here are completely bogus. Also ..._available attributes
are supposed to be used for properties that only support discrete sets of
values, but we accept continuous values and will round to the next supported
frequency.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
A negative sampling frequency is obviously invalid, so use kstrtouint() instead
of strict_strtoul. Also when setting a sampling frequency smaller than the
minimum supported frequency set the frequency to the minimum supported frequency
instead of just cutting off the upper bits of the raw register value.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
While the inclination channel claims to support reading the scale the driver did
not implement this, so trying to read the scale results in a -EINVAL. This patch
fixes it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
All channels for this device have the same number of bits for calibscale and
caliboffset, there is no need to determine it dynamically based on the channel
type. Also there is no locking required since adis_read_reg_16() will take care
of proper locking on its own.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Instead of just cutting of the upper bits of the value make sure that the value
is in the valid range and return an error if it is not.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The header is only used by a single C file, just put the register defines
directly into that C file and remove the header.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The recomentation for IIO driver is to leave all scan elements off by default
and let userspace decide which channels need to be enabled.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The adis16260 driver implements a unique feature in that it allows to change the
orientation of the gyroscope channel by specifying the orientation in platform
data. This feature is as far as I can see unused though and makes the driver
unnecessarily complex. So this patch removes the support for it. If it turns
out we need this, the cleanest approach to implement it is by adding support for
orientation mapping inside the IIO core so it is available to all drivers.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Remove the unused 'negate' property from the driver state struct. This also
means we can now use the adis struct directly as the driver data.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Return the actual value read from the device and not just the mask.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Using devm_iio_device_alloc makes code simpler.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Using devm_iio_device_alloc makes code simpler.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
There is no reason why userspace should want to trigger a manual reset of the
device, so remove this functionality.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
There is no reason why userspace should want to trigger a manual reset of the
device, so remove this functionality.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
There is no reason why userspace should want to trigger a manual reset of the
device, so remove this functionality.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
stmp_reset_block() may fail, so let's check its return value and propagate it in
the case of error.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>