Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fbcca25 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix access to released memory in clk_debugfs_register_one()
  sh: Fix access to released memory in dwarf_unwinder_cleanup()
  usb: r8a66597-hdc disable interrupts fix
  spi: spi_sh_msiof: Fixed data sampling on the correct edge
parents e770a0f1 bc10e875
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -598,7 +598,7 @@ static struct dentry *clk_debugfs_root;
static int clk_debugfs_register_one(struct clk *c)
{
	int err;
	struct dentry *d, *child;
	struct dentry *d, *child, *child_tmp;
	struct clk *pa = c->parent;
	char s[255];
	char *p = s;
@@ -630,7 +630,7 @@ static int clk_debugfs_register_one(struct clk *c)

err_out:
	d = c->dentry;
	list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
	list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child)
		debugfs_remove(child);
	debugfs_remove(c->dentry);
	return err;
+4 −4
Original line number Diff line number Diff line
@@ -892,18 +892,18 @@ static struct unwinder dwarf_unwinder = {

static void dwarf_unwinder_cleanup(void)
{
	struct dwarf_cie *cie;
	struct dwarf_fde *fde;
	struct dwarf_cie *cie, *cie_tmp;
	struct dwarf_fde *fde, *fde_tmp;

	/*
	 * Deallocate all the memory allocated for the DWARF unwinder.
	 * Traverse all the FDE/CIE lists and remove and free all the
	 * memory associated with those data structures.
	 */
	list_for_each_entry(cie, &dwarf_cie_list, link)
	list_for_each_entry_safe(cie, cie_tmp, &dwarf_cie_list, link)
		kfree(cie);

	list_for_each_entry(fde, &dwarf_fde_list, link)
	list_for_each_entry_safe(fde, fde_tmp, &dwarf_fde_list, link)
		kfree(fde);

	kmem_cache_destroy(dwarf_reg_cachep);
+6 −9
Original line number Diff line number Diff line
@@ -173,15 +173,12 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
	int edge;

	/*
	 * CPOL CPHA     TSCKIZ RSCKIZ TEDG REDG(!)
	 *    0    0         10     10    1    0
	 *    0    1         10     10    0    1
	 *    1    0         11     11    0    1
	 *    1    1         11     11    1    0
	 *
	 * (!) Note: REDG is inverted recommended data sheet setting
	 * CPOL CPHA     TSCKIZ RSCKIZ TEDG REDG
	 *    0    0         10     10    1    1
	 *    0    1         10     10    0    0
	 *    1    0         11     11    0    0
	 *    1    1         11     11    1    1
	 */

	sh_msiof_write(p, FCTR, 0);
	sh_msiof_write(p, TMDR1, 0xe2000005 | (lsb_first << 24));
	sh_msiof_write(p, RMDR1, 0x22000005 | (lsb_first << 24));
@@ -193,7 +190,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
	edge = cpol ? cpha : !cpha;

	tmp |= edge << 27; /* TEDG */
	tmp |= !edge << 26; /* REDG */
	tmp |= edge << 26; /* REDG */
	tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */
	sh_msiof_write(p, CTR, tmp);
}
+16 −1
Original line number Diff line number Diff line
@@ -216,8 +216,17 @@ static void disable_controller(struct r8a66597 *r8a66597)
{
	int port;

	/* disable interrupts */
	r8a66597_write(r8a66597, 0, INTENB0);
	r8a66597_write(r8a66597, 0, INTSTS0);
	r8a66597_write(r8a66597, 0, INTENB1);
	r8a66597_write(r8a66597, 0, BRDYENB);
	r8a66597_write(r8a66597, 0, BEMPENB);
	r8a66597_write(r8a66597, 0, NRDYENB);

	/* clear status */
	r8a66597_write(r8a66597, 0, BRDYSTS);
	r8a66597_write(r8a66597, 0, NRDYSTS);
	r8a66597_write(r8a66597, 0, BEMPSTS);

	for (port = 0; port < r8a66597->max_root_hub; port++)
		r8a66597_disable_port(r8a66597, port);
@@ -2466,6 +2475,12 @@ static int __devinit r8a66597_probe(struct platform_device *pdev)
	r8a66597->rh_timer.data = (unsigned long)r8a66597;
	r8a66597->reg = (unsigned long)reg;

	/* make sure no interrupts are pending */
	ret = r8a66597_clock_enable(r8a66597);
	if (ret < 0)
		goto clean_up3;
	disable_controller(r8a66597);

	for (i = 0; i < R8A66597_MAX_NUM_PIPE; i++) {
		INIT_LIST_HEAD(&r8a66597->pipe_queue[i]);
		init_timer(&r8a66597->td_timer[i]);