lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1353531886.24807.43.camel@joe-AO722>
Date:	Wed, 21 Nov 2012 13:04:46 -0800
From:	Joe Perches <joe@...ches.com>
To:	George Zhang <georgezhang@...are.com>
Cc:	linux-kernel@...r.kernel.org,
	virtualization@...ts.linux-foundation.org, pv-drivers@...are.com,
	gregkh@...uxfoundation.org
Subject: Re: [PATCH 01/12] VMCI: context implementation.

On Wed, 2012-11-21 at 12:31 -0800, George Zhang wrote:
> VMCI Context code maintains state for vmci and allows the driver to communicate
> with multiple VMs

Just some trivial notes.

> diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c
[]

It'd be nicer if you added this #define before any #include
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
so that pr_<level> messages are prefixed.
(never mind, found a similar macro in patch 12/12)

> +#include <linux/vmw_vmci_defs.h>
> +#include <linux/vmw_vmci_api.h>
[]
> +	context = kzalloc(sizeof(*context), GFP_KERNEL);
> +	if (!context) {
> +		pr_warn("Failed to allocate memory for VMCI context.\n");

OOM logging messages aren't necessary as alloc failures
are already logged with a stack trace.

That goes for the entire patch series.

> +	/* Fire event to all subscribers. */
> +	array_size = vmci_handle_arr_get_size(subscriber_array);
> +	for (i = 0; i < array_size; i++) {
> +		int result;
> +		struct vmci_event_msg *e_msg;
> +		struct vmci_event_payld_ctx *ev_payload;
> +		char buf[sizeof(*e_msg) + sizeof(*ev_payload)];

Maybe just use
	struct vmci_event_msg e_msg;
	struct vmci_event_payld_ctx ev_payload;
and change the addressing or use a cast as appropriate?

> +	/* Allocate guest call entry and add it to the target VM's queue. */
> +	dq_entry = kmalloc(sizeof(*dq_entry), GFP_KERNEL);
> +	if (dq_entry == NULL) {
> +		pr_warn("Failed to allocate memory for datagram.\n");

Another unnecessary OOM message.

You also have some inconsistency in whether or not your
logging messages use a terminating period.  I suggest
you just delete all the periods.
	s/\.\\n"/\\n"/g


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ