aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/ds.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index 5ef48dab5636..11d460f6f9cc 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -783,6 +783,16 @@ void ldom_set_var(const char *var, const char *value)
783 char *base, *p; 783 char *base, *p;
784 int msg_len, loops; 784 int msg_len, loops;
785 785
786 if (strlen(var) + strlen(value) + 2 >
787 sizeof(pkt) - sizeof(pkt.header)) {
788 printk(KERN_ERR PFX
789 "contents length: %zu, which more than max: %lu,"
790 "so could not set (%s) variable to (%s).\n",
791 strlen(var) + strlen(value) + 2,
792 sizeof(pkt) - sizeof(pkt.header), var, value);
793 return;
794 }
795
786 memset(&pkt, 0, sizeof(pkt)); 796 memset(&pkt, 0, sizeof(pkt));
787 pkt.header.data.tag.type = DS_DATA; 797 pkt.header.data.tag.type = DS_DATA;
788 pkt.header.data.handle = cp->handle; 798 pkt.header.data.handle = cp->handle;