Commit Graph

27 Commits (70e522a02838e52ca007d3f183171fd9324eceb4)

Author SHA1 Message Date
Dan Carpenter 0c849b3c16 Staging: vt6655: add some range checks before memcpy()
There were no range checks in the original code so the user could
write past the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:13:20 +02:00
Dan Carpenter 0d3eb2b29f Staging: vt6655: whitespace fixes to iotcl.c
The indents didn't line up at all in the original code.  I also fixed
a bunch of other white issues as I went along.  I changed the comment
style and removed some commented out code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-23 10:13:20 +02:00
Dan Carpenter de0920b1fe Staging: vt6655-6: potential info leak in private_ioctl()
Smatch has a new check for Rosenberg type information leaks where
structs are copied to the user with uninitialized stack data in them.

In this path, the .uLinkRate member doesn't get initialized so I've
set it to zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:43:44 -07:00
Joe Perches 273f4bef18 staging: Remove unnecessary semicolons when for (foo) {...};
Done via perl script:

$ cat remove_semi_for.pl
my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;

foreach my $file (@ARGV) {
    my $f;
    my $text;
    my $oldtext;

    next if ((-d $file));

    open($f, '<', $file)
	or die "$P: Can't open $file for read\n";
    $oldtext = do { local($/) ; <$f> };
    close($f);

    next if ($oldtext eq "");

    $text = $oldtext;

    my $count = 0;
    do {
	$count = 0;
	$count += $text =~ s@\b(for\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
    } while ($count > 0);

    if ($text ne $oldtext) {
	my $newfile = $file;

	open($f, '>', $newfile)
	    or die "$P: Can't open $newfile for write\n";
	print $f $text;
	close($f);
    }
}

$

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 16:58:35 -07:00
Joe Perches 9fc86028fa staging: Remove unnecessary semicolons when if (foo) {...};
Done via perl script:

$ cat remove_semi_if.pl
my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;

foreach my $file (@ARGV) {
    my $f;
    my $text;
    my $oldtext;

    next if ((-d $file));

    open($f, '<', $file)
	or die "$P: Can't open $file for read\n";
    $oldtext = do { local($/) ; <$f> };
    close($f);

    next if ($oldtext eq "");

    $text = $oldtext;

    my $count = 0;
    do {
	$count = 0;
	$count += $text =~ s@\b(if\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
    } while ($count > 0);

    if ($text ne $oldtext) {
	my $newfile = $file;

	open($f, '>', $newfile)
	    or die "$P: Can't open $newfile for write\n";
	print $f $text;
	close($f);
    }
}

$

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 16:58:34 -07:00
Charles Clément 5a5a2a6ad4 Staging: vt6655: replace FALSE with in kernel false
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:17:38 -07:00
Charles Clément 1b12068a80 Staging: vt6655: replace TRUE with in kernel true
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:17:12 -07:00
Charles Clément 3fc9b584c2 Staging: vt6655: remove BYTE typedef
Replace all occurrences with unsigned char type.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-24 14:23:18 -07:00
Charles Clément 2986db5fd3 Staging: vt6655: remove WORD typedef
Replace all occurrences with unsigned short type.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-24 14:23:17 -07:00
Charles Clément 0f4c60d61e Staging: vt6655: remove DWORD typedef
Replace all occurrences with unsigned long type, except for pointer fields that
should be u32 in packed structures and 8-byte-aligned 8 byte long structure
QWORD.

Thanks to Jiri Slaby for pointing out that simply replacing by unsigned long is
wrong on x86-64 arch.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-24 14:23:17 -07:00
Charles Clément 9d828c458f Staging: vt6655: remove PDWORD typedef
Use unsigned long * instead.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:20:03 -07:00
Charles Clément 2989e96f17 Staging: vt6655: remove PBYTE typedef
Use unsigned char * instead.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:20:03 -07:00
Charles Clément e3fd16d081 Staging: vt6655: remove custom ULONG typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:19:04 -07:00
Charles Clément b6e95cd52a Staging: vt6655: remove custom UINT typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:18:45 -07:00
Charles Clément b83cc2ed46 Staging: vt6655: remove custom LONG typedef
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 10:11:16 -07:00
Charles Clément 078b078f66 Staging: vt6655: use ETH_ALEN macro instead of custom one
Replaced custom ethernet address length definition U_ETHER_ADDR_LEN by
ETH_ALEN from <linux/if_ether.h>.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-17 16:26:42 -07:00
Charles Clément 3a215e0ff4 Staging: vt6655: remove IN definition
Remove empty IN definition used to specify input parameters.

Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14 13:24:03 -07:00
Charles Clément e64354c0be Staging: vt6655: remove HANDLE definition and use
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14 13:20:35 -07:00
Charles Clément 6b35b7b379 Staging: vt6655: remove VOID definition and use
Signed-off-by: Charles Clément <caratorn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 14:56:28 -07:00
Forest Bond ecf739e695 Staging: vt6655: Rename hostap_set_hostapd, hostap_iotctl.
The functions hostap_set_hostapd, hostap_iotctl clashed with functions of the
same name with CONFIG_HOSTAP=y and/or CONFIG_VT6656=y.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:56 -07:00
Ng Kian Yong b46966ee8f Staging: vt6655: fix brace coding style issue in ioctl.c
This is a patch to the ioctl.c file that fixes up a brace warning found
by the checkpatch.pl tool

Signed-off-by: Ng Kian Yong <ngky@comp.nus.edu.sg>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:54 -07:00
André Goddard Rosa bbc9a9916b Staging: fix assorted typos all over the place
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
Jim Lieb 51b6d9c299 Staging: vt665x: Remove umem.h Part 1
Remove references to umem.h macros and refer directly to memcpy
functions.  Delete the include file.

Signed-off-by: Jim Lieb <lieb@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:08 -07:00
Jim Lieb a7ad322a46 Staging: vt665x: Clean up include files, Part 2
Remove cplusplus lines from include files
Remove needless ifdefs on includes to conform with C
conventions.  Remove misc commented code/includes
Update TODO

Signed-off-by: Jim Lieb <lieb@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:08 -07:00
Jim Lieb 612822f5dd Staging: vt665x: Text janitor in prep for driver merge, part 2
Text only changes to remove textual differences between the vt6655
and vt6656 trees in prep for driver merge.

Signed-off-by: Jim Lieb <lieb@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:07 -07:00
Jim Lieb 7e809a9b10 Staging: vt6655 textual cleanup in prep for driver merge
The vt6655 and vt6656 drivers are from a common origin but
have drifted apart with minor textual differences.  There
are two changes:

  s/DEVICE_PRT/DBG_PRT/g

and

  s/byPktTyp/byPktType/g

This significantly reduces the differences between the two file sets
in preparation to merging the common code.  A few whitespace and text bits were
also adjusted.

Signed-off-by: Jim Lieb <lieb@canonical.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:07 -07:00
Forest Bond 5449c685a4 Staging: Add pristine upstream vt6655 driver sources
Add pristine upstream vt6655 driver sources to drivers/staging/vt6655.  These
files were literally copied from the driver directory in the upstream source
archive, available here:

  http://www.viaarena.com/Driver/vt6655_linux_src_v1.19.12_x86.zip

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00